• Entries (RSS)
  • Comments (RSS)

org.xml.sax.SAXException: WSWS3047E: Error: Cannot deserialize element

Posted by | Posted in Websphere Process Server / Integration Developer | Posted on 22-10-2008

Tagged Under : , , , , ,

Yesterday I came across a new exception while invoking my web service using WebSphere Process Server. I was trying to invoke an external web service from WID. The exception or web service fault message I was getting was

CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "transactionNotSupportedActivitySessionNotSupported" on bean "BeanId(CustomerProfileApp#CustomerProfileEJB.jar#Module, null)". Exception data: com.ibm.websphere.sca.ServiceRuntimeException: <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Fault><faultcode>soapenv:Server.generalException</faultcode><faultstring>org.xml.sax.SAXException: WSWS3047E: Error: Cannot deserialize element elementName of bean beanName. To see the message containing the parsing error in the log, either enable web service engine tracing or set MessageContext.setHighFidelity(true).</faultstring></soapenv:Fault></soapenv:Body>
	at com.ibm.wsspi.sca.webservice.jaxrpc.ServiceImportHandler.handleFault(ServiceImportHandler.java:313)
	at com.ibm.ws.webservices.engine.handlers.jaxrpc.HandlerProxy.handleFault(HandlerProxy.java:159)
	at com.ibm.ws.webservices.engine.handlers.jaxrpc.JAXRPCHandlerChain.oneHandleFault(JAXRPCHandlerChain.java:869)
	at com.ibm.ws.webservices.engine.handlers.jaxrpc.JAXRPCHandlerChain.handleFault(JAXRPCHandlerChain.java:846)
	at com.ibm.ws.webservices.engine.handlers.jaxrpc.JAXRPCHandlerChain.handleFault(JAXRPCHandlerChain.java:839)
	at com.ibm.ws.webservices.engine.handlers.jaxrpc.JAXRPCHandler.invokeClientFaultHandler(JAXRPCHandler.java:535)
	at com.ibm.ws.webservices.engine.handlers.jaxrpc.JAXRPCHandler$3.onFault(JAXRPCHandler.java:453)
	at com.ibm.ws.webservices.engine.PivotHandlerWrapper.onFault(PivotHandlerWrapper.java:516)
	at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:317)
	at com.ibm.ws.webservices.engine.WebServicesEngine.invoke(WebServicesEngine.java:336)
	at com.ibm.ws.webservices.engine.client.Connection.invokeEngine(Connection.java:929)
	at com.ibm.ws.webservices.engine.client.Connection.invoke(Connection.java:722)

This usually happens when you have an array of complex types. There is a technote available from IBM and they are providing three different solution. I just followed one of the solutions given by that technote. So to resolve this issue follow the below steps.

1. Open your WSDL file
2. Search for the elementName that cannot be serialized.
3. If you found an entry like

	<element name="elementName" nillable="true" type="someComplexType" />

4. Add ‘ xmlns=”"‘ to that element.

5. Now your element definition will look like

	<element name="elementName" nillable="true" type="someComplexType"  xmlns="" />

This will resolve the issue. At least it solved my problem. However the IBM recommended solution is to use the proper namespace.

  • Share/Bookmark

Read More

Post a Comment