我有一個針對IBM WebSphere JRE編譯的JAX-WS web服務,它似乎與預先安裝/配置了JBoss7的cxf堆棧不兼容,但可以與WebSphere/Axis2 。我不確定爲什麼我看到這種不兼容性,因爲我沒有使用任何Axis2特定的類(僅使用javax.ws類),但無論如何,我遇到類不兼容問題。CXF與WebSphere JRE不兼容
我的課沒有直接依賴於Axis2,這就是爲什麼我期待該服務可以找到與cxf,但顯然不是。我只使用javax.xml.ws.WebServiceContext
和javax.xml.ws.handler.soap.SOAPMessageContext
。
只是爲了安全起見,我已經瀏覽了所有的pacakged jar文件,並且沒有在任何地方找到javax.xml.ws.handler.soap.SOAPMessageContext。這很好,因爲它屬於JRE。這導致我相信我的JRE(IBM JRE)提供的javax.xml.ws與CXF堆棧之間存在不兼容性。
因此,我想我會嘗試運行Axis2堆棧的服務,但我不知道如何在JBoss7下安裝它。
如果有人能幫助我理解不兼容性和/或如何讓Axis2與JBoss7一起工作,我將不勝感激。
完整堆棧跟蹤:
11:39:02,121 WARNING [org.apache.cxf.phase.PhaseInterceptorChain] (http-0.0.0.0-0.0.0.0-8080-1) Application {http://www.com/ClientServices/LendingSimulation/V1.2}LendingSimulationService#{http://www.com/ClientServices/LendingSimulation/V1.2}calculateBorrowingData has thrown exception, unwinding now: org.apache.cxf.interceptor.Fault: org.apache.cxf.jaxws.context.WrappedMessageContext incompatible with javax.xml.ws.handler.soap.SOAPMessageContext
at org.jboss.wsf.stack.cxf.JBossWSInvoker.createFault(JBossWSInvoker.java:234)
at org.jboss.wsf.stack.cxf.JBossWSInvoker._invokeInternal(JBossWSInvoker.java:189)
at org.jboss.wsf.stack.cxf.JBossWSInvoker.invoke(JBossWSInvoker.java:117)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:452) [:6.0]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:314) [:6.0]
at java.util.concurrent.FutureTask.run(FutureTask.java:149) [:6.0]
at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:118)
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:208)
at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:91)
at org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:162)
at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:87)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:184)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at org.jboss.wsf.stack.cxf.CXFServletExt.service(CXFServletExt.java:135)
at org.jboss.wsf.spi.deployment.WSFServlet.service(WSFServlet.java:138) [jbossws-spi-2.0.0.Beta7.jar:2.0.0.Beta7]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:139) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at java.lang.Thread.run(Thread.java:735) [:6.0]
Caused by: java.lang.ClassCastException: org.apache.cxf.jaxws.context.WrappedMessageContext incompatible with javax.xml.ws.handler.soap.SOAPMessageContext
at com.clientservices.lendingsimulation.util.SoapUtil.extractServiceContextFromHeader(SoapUtil.java:43) [classes:]
at com.clientservices.lendingsimulation.service.LendingSimulationServiceImpl.calculateBorrowingData(LendingSimulationServiceImpl.java:112) [classes:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:6.0]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45) [:6.0]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) [:6.0]
at java.lang.reflect.Method.invoke(Method.java:599) [:6.0]
at org.jboss.ws.common.invocation.AbstractInvocationHandlerJSE.invoke(AbstractInvocationHandlerJSE.java:111)
at org.jboss.wsf.stack.cxf.JBossWSInvoker._invokeInternal(JBossWSInvoker.java:169)
... 33 more
謝謝!
埃裏克