未检测到 AS4 模块且文件传输失败

AS4 module not detected and file transfer fails

我已经部署了一个带有 AS4 模块的 Oxalis 实例。

OS : Ubuntu 18.04
JDK : openjdk version "1.8.0_222"
Oxalis : v4.0.4
Oxalis-AS4: Oxalis-AS4 RC8

调用 http://localhost:8080/oxalis/as4 时收到正确的响应(Hello AS4 World)。

但是当我尝试使用 oxalis-standalone.jar 将文件发送到 AS4 端点并将 oxalis-as4 jar 文件包含在类路径中时,oxalis-standalone 会产生以下错误。 它还显示仅部署了 AS2 个传输配置文件。

酢浆草-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

服务器抛出以下异常。

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)

我已经在两台计算机上部署了它,并产生了相同的结果。

是什么导致了这个问题?在此先感谢您的支持!!

此致, 戒日

您似乎没有为 oxalis-standalone jar 使用 AS4 扩展。 由于这个原因,您没有将 jars 提取到文件夹中,或者您在调用 oxalis-standalone.jar 以使用该文件夹时没有更改类路径。 请查看 https://github.com/difi/Oxalis-AS4 上的 README.md。

推荐的结构如下所示:

├── 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
    └── ...

命令如下所示:

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

那么您的日志中应该会出现以下内容 - 这表明支持 AS4:

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```