Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exception thrown by application class 'com.sun.xml.messaging.saaj.soap.SOAPPartImpl.:119'

I am trying to Deploy a Java application over Bluemix. When I deploy it on my local Liberty Server(Liberty 16.0.0.2), it works fine and I am able to hit the URL from a SOAP client.

But when I try it on Bluemix, it gives me this error:

Exception thrown by application class 'com.sun.xml.messaging.saaj.soap.SOAPPartImpl.:119' java.lang.VerifyError: JVMVRFY012 stack shape inconsistent; class=com/sun/xml/messaging/saaj/soap/SOAPDocumentImpl, method=createDocumentFragment()Lorg/w3c/dom/DocumentFragment;, pc=5; Type Mismatch, argument 0 in signature com/sun/xml/messaging/saaj/soap/SOAPDocumentFragment.:(Lcom/sun/org/apache/xerces/internal/dom/CoreDocumentImpl;)V does not match Exception Details: Location: com/sun/xml/messaging/saaj/soap/SOAPDocumentImpl.createDocumentFragment()Lorg/w3c/dom/DocumentFragment; @5: JBinvokespecial Reason: Type 'com/sun/xml/messaging/saaj/soap/SOAPDocumentImpl' (current frame, stack[2]) is not assignable to 'com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl' Current Frame: bci: @5 flags: { } locals: { 'com/sun/xml/messaging/saaj/soap/SOAPDocumentImpl' } stack: { 'uninitialized', 'uninitialized', 'com/sun/xml/messaging/saaj/soap/SOAPDocumentImpl' } at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.(SOAPPartImpl.java:119) at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.(SOAPPart1_1Impl.java:89) at com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl.getSOAPPart(Message1_1Impl.java:109) at org.apache.cxf.binding.soap.saaj.SAAJInInterceptor.handleMessage(SAAJInInterceptor.java:101) at org.apache.cxf.jaxws.handler.soap.SOAPMessageContextImpl.getMessage(SOAPMessageContextImpl.java:78) at org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.getOpQName(SOAPHandlerInterceptor.java:294) at org.apache.cxf.jaxws.handler.AbstractJAXWSHandlerInterceptor.setupBindingOperationInfo(AbstractJAXWSHandlerInterceptor.java:111) at org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.createProtocolMessageContext(SOAPHandlerInterceptor.java:235) at org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.handleMessageInternal(SOAPHandlerInterceptor.java:144) at org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.handleMessage(SOAPHandlerInterceptor.java:119) at org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.handleMessage(SOAPHandlerInterceptor.java:69) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:89) at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:99) at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:368) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:183) at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:163) at org.apache.cxf.transport.servlet.AbstractCXFServlet.doGet(AbstractCXFServlet.java:145) at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1290) at [internal classes]

I already tried deploying packaged liberty server and Server directory options. But it doesn't work. I also tried, with ibm-web-ext.xml approach, where we change fileServingEnabled="false". But it gives the same error.

like image 878
voucher_wolves Avatar asked Oct 18 '22 06:10

voucher_wolves


2 Answers

This is due to conflict of libraries between SOAP CFX Services (this might be bundled by the app) and the libraries in JRE.

To overcome this, pass the following as VM arguments to instruct your JVM to use appropriate libraries bundled with JRE (instead of CFX).

javax.xml.soap.MessageFactory = com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl javax.xml.soap.SOAPFactory = com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl javax.xml.soap.SOAPConnectionFactory = com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnectionFactory javax.xml.soap.MetaFactory = com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl

like image 122
Dinesh Venkatraman Avatar answered Oct 21 '22 02:10

Dinesh Venkatraman


Just to expand upon Dinesh's answer, in order to instruct the Bluemix JVM to use your bundled libraries (instead of CFX), add the following to jvm.options in the server root (create if necessary):

-Djavax.xml.soap.MessageFactory=com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl
-Djavax.xml.soap.SOAPFactory=com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl
-Djavax.xml.soap.SOAPConnectionFactory=com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnectionFactory
-Djavax.xml.soap.MetaFactory=com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl
like image 22
Justin Stenning Avatar answered Oct 21 '22 01:10

Justin Stenning