使用Websphere Liberty配置文件17.0.0.4发现此问题。当我发出单向请求时,这会产生一个空指针。它适用于请求 - 响应服务。
我是一个春季启动应用程序。该代码可以作为运行嵌入式tomcat容器的独立springboot应用程序运行良好。
在Websphere自由配置文件中运行时发生错误。我已经禁用了在WLP中部署的嵌入式容器
java.lang.NullPointerException: null
at com.ibm.ws.webcontainer.osgi.collaborator.CollaboratorHelperImpl.getCurrentSecurityCollaborator(CollaboratorHelperImpl.java:286) ~[na:na]
at com.ibm.ws.webcontainer.srt.SRTServletRequest.getUserPrincipal(SRTServletRequest.java:2796) ~[na:na]
at org.apache.cxf.transport.http.AbstractHTTPDestination$2.getUserPrincipal(AbstractHTTPDestination.java:392) ~[cxf-rt-transports-http-3.2.1.jar:3.2.1]
at org.apache.camel.component.cxf.DefaultCxfBinding.populateExchangeFromCxfRequest(DefaultCxfBinding.java:274) ~[camel-cxf-2.20.1.jar:2.20.1]
at org.apache.camel.component.cxf.CxfConsumer$CxfConsumerInvoker.prepareCamelExchange(CxfConsumer.java:316) ~[camel-cxf-2.20.1.jar:2.20.1]
at org.apache.camel.component.cxf.CxfConsumer$CxfConsumerInvoker.syncInvoke(CxfConsumer.java:253) ~[camel-cxf-2.20.1.jar:2.20.1]
at org.apache.camel.component.cxf.CxfConsumer$CxfConsumerInvoker.invoke(CxfConsumer.java:183) ~[camel-cxf-2.20.1.jar:2.20.1]
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59) ~[cxf-core-3.2.1.jar:3.2.1]
答案 0 :(得分:0)
我通过覆盖DefaultCxfBinding解决了这个问题。我暂时禁用了securityContext的创建。 CFX JMSConfig可以通过将createSecurityContext设置为false来执行此操作。甚至HTTP传输都应具有此功能
@覆盖 public void populateExchangeFromCxfRequest(Exchange cxfExchange,org.apache.camel.Exchange camelExchange){
find(abs(forceZ1(:,1234)) < 1e-5)
}