Q:

AS4 module not detected and file transfer fails

I have deployed an Oxalis instance with AS4 module. 
OS : Ubuntu 18.04
JDK : openjdk version "1.8.0_222"
Oxalis : v4.0.4
Oxalis-AS4: Oxalis-AS4 RC8

when calling http://localhost:8080/oxalis/as4 proper response is received (Hello AS4 World).
But when I try to send a file to AS4 endpoint using oxalis-standalone.jar with oxalis-as4 jar files included in the classpath, following error is produced by oxalis-standalone. 
It also shows that only AS2 transport profiles are deployed.
oxalis-standalone.log
oxalis-standalone.log
2019-09-17 15:01:13,028 WARN [no.difi.oxalis.outbound.transmission.TransmissionRequestBuilder] Endpoint was set by caller not retrieved from SMP, make sure this is intended behaviour. 
2019-09-17 15:01:14,107 ERROR [eu.sendregning.oxalis.Main] Execution failed: no.difi.oxalis.api.lang.OxalisTransmissionException: No Content-Type header in response, probably a server error. 
java.util.concurrent.ExecutionException: no.difi.oxalis.api.lang.OxalisTransmissionException: No Content-Type header in response, probably a server error.
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:192)
    at eu.sendregning.oxalis.Main.main(Main.java:227)
Caused by: no.difi.oxalis.api.lang.OxalisTransmissionException: No Content-Type header in response, probably a server error.
    at no.difi.oxalis.as2.outbound.As2MessageSender.handleResponse(As2MessageSender.java:287)
    at no.difi.oxalis.as2.outbound.As2MessageSender.sendHttpRequest(As2MessageSender.java:247)
    at no.difi.oxalis.as2.outbound.As2MessageSender.send(As2MessageSender.java:156)
    at no.difi.oxalis.as2.outbound.As2MessageSenderFacade.send(As2MessageSenderFacade.java:58)
    at no.difi.oxalis.outbound.transmission.DefaultTransmitter.perform(DefaultTransmitter.java:149)
    at no.difi.oxalis.outbound.transmission.DefaultTransmitter.transmit(DefaultTransmitter.java:93)
    at eu.sendregning.oxalis.TransmissionTask.performTransmission(TransmissionTask.java:168)
    at eu.sendregning.oxalis.TransmissionTask.call(TransmissionTask.java:96)
    at eu.sendregning.oxalis.TransmissionTask.call(TransmissionTask.java:49)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Total time spent: 1s
Attempted to send 0 files
Failed transmissions: 1

Server throws following exception.
catalina.out
catalina.out.log
14:28:30.084 [http-nio-8080-exec-8] WARN  o.a.cxf.phase.PhaseInterceptorChain - Interceptor for has thrown exception, unwinding now
org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader: Unexpected character '-' (code 45) in prolog; expected '<'
 at [row,col {unknown-source}]: [1,1]
    at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:292)
    at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:70)

I have deployed this on two computers, and produces the same result.
What can be causing this issue ? Thanks in advance for your support !!
Regards,
Harsha

A:

It seems like you do not use the AS4 extension for oxalis-standalone jar.
Either you didn't extract the jars into a folder due to this or you didn't change the classpath when calling oxalis-standalone.jar to use that folder.
Please have a look at the README.md at https://github.com/difi/Oxalis-AS4.
The recommended structure looks like this:
├── standalone/    <-- We will putt our regular Oxalis Standalone application here...
│   ├── oxalis-standalone.jar
│   ├── posibly-other.jar
│   └── ...
└── as4/    <-- ...and our AS4 extension here
    ├── oxalis-as4.jar
    ├── many-other.jar
    └── ...

The command looks like this:
java -classpath "standalone/*;as4/*" eu.sendregning.oxalis.Main [followd by the argument like -f c:\some-invoice.xml]

Then the following should appear in your log - that signals the AS4 support:
INFO [no.difi.oxalis.outbound.transmission.MessageSenderFactory] => peppol-transport-as4-v2_0
INFO [no.difi.oxalis.outbound.transmission.MessageSenderFactory] => busdox-transport-as2-ver1p0r1
INFO [no.difi.oxalis.outbound.transmission.MessageSenderFactory] => busdox-transport-as2-ver2p0
INFO [no.difi.oxalis.outbound.transmission.MessageSenderFactory] => busdox-transport-as2-ver1p0```

