This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Services and the fly likes Problem in custom axis (De)Serializers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Problem in custom axis (De)Serializers" Watch "Problem in custom axis (De)Serializers" New topic
Author

Problem in custom axis (De)Serializers

Rr Kumaran
Ranch Hand

Joined: Sep 17, 2001
Posts: 548
Hi All,

I am using JiBX for implementing my own (De)Serializers replacing AXIS default (De)Serializers. However when I register my (De)Serializers with AXIS's server-config.wsdd file and start my web service deployed on WebSphere 5.0, I am getting below detailed server stack trace :


[2/6/05 17:04:20:345 IST] 39ce702e WebGroup I SRVE0180I: [Apache-Axis] [/Axis11Rc2IrscEjbWeb] [Servlet.LOG]: AdminServlet: init
[2/6/05 17:04:20:814 IST] 39ce702e WebGroup I SRVE0180I: [Apache-Axis] [/Axis11Rc2IrscEjbWeb] [Servlet.LOG]: SOAPMonitorService: init
[2/6/05 17:05:03:204 IST] 152a3029 WebGroup I SRVE0180I: [Apache-Axis] [/Axis11Rc2IrscEjbWeb] [Servlet.LOG]: AxisServlet: init
[2/6/05 17:05:07:236 IST] 152a3029 WebGroup E SRVE0026E: [Servlet Error]-[: incorrect call to interface method ]: java.lang.IncompatibleClassChangeError: : incorrect call to interface method
at com.tri.TriJibxDeser.onEndElement(TriJibxDeser.java:74)
at org.apache.axis.encoding.DeserializerImpl.endElement(DeserializerImpl.java:534)
at org.apache.axis.encoding.DeserializationContextImpl.endElement(DeserializationContextImpl.java:1001)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:204)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:718)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:232)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:346)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:184)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:330)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:475)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:323)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:854)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:948)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:530)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:176)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:201)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:610)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:431)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)



Here is the code of my JiBX Deserializer java class :


--------------------------------------------------------
public class TriJibxDeser extends DeserializerImpl
{

public TriJibxDeser(Class clas, QName qname, IUnmarshallingContext uctx)
{
m_javaType = clas;
m_xmlType = qname;
m_context = uctx;
}

public void onEndElement(String ns, String lname, DeserializationContext dctx)
throws SAXException
{
if(!m_xmlType.getNamespaceURI().equals(ns) || !m_xmlType.getLocalPart().equals(lname))
{
throw new SAXException("incompatable type passed to JiBX deserializer");
}
MessageElement element = dctx.getCurElement();
if(element != null)
{
String text = null;
try
{
text = element.toString();
value = m_context.unmarshalDocument(new StringReader(text));
}
catch(JiBXException e)
{
throw new SAXException("error in JiBX deserialization : " + e.getMessage(), e);
}
catch(Exception e)
{
throw new SAXException("Error reading element text: " + e.getMessage(), e);
}
}
}

private static Log s_log;
private QName m_xmlType;
private Class m_javaType;
private IUnmarshallingContext m_context;
}
--------------------------------------------------------



Can anyone tell how do I go ahead and debug this problem and find a solution. Please suggest ?


Thanks & Regards,
Kumar.


RR Kumaran
SCJP 1.4
Ashutosh Shahi
Ranch Hand

Joined: Feb 06, 2005
Posts: 36
I haven't looked at the code provided by you. But i faced the problem of incompatible class change errors when the Axuis JARS used at client and server were not in sync. Try to make sure u don't have any outdated jars in ur classpath.
Ashutosh


<a href="http://blogs.sun.com/roller/page/ashutosh" target="_blank" rel="nofollow">http://blogs.sun.com/roller/page/ashutosh</a>
Rr Kumaran
Ranch Hand

Joined: Sep 17, 2001
Posts: 548
Are you talking about the wrong version of my Custom (De)Serializers on both client and server ?

I have checked above point and they are same. But what does this error actually mean ?

Thanks & Regards,
Ashutosh Shahi
Ranch Hand

Joined: Feb 06, 2005
Posts: 36
No, it need not be only serializer/deserializer class. The exception occurs as axis fails to serialize something, so u see a stack trace with serializer class, but the problem need not necessarily be there.
What i meant was perhaps the Axis 1.2 jars that u r using at client and server are not the same, if u downloaded nightly builds, they might have been downloaded on different dates.
Ashutosh
Ashutosh Shahi
Ranch Hand

Joined: Feb 06, 2005
Posts: 36
Well, just found out that the saaj.jar in Axis 1.2 RC2 is newer than the one in Websphere. So u must tell websphere to use the saaj.jar in ur webapp.
For example set the Classpath and the "Websphere specific Classpath" in your WSAD:
C:\projects\sources\....\WebContent\WEB-INF\lib\saaj.jar

Ashutosh
Rr Kumaran
Ranch Hand

Joined: Sep 17, 2001
Posts: 548
in my case, how r u sure that it is the problem with the saaj.jar ?
Ashutosh Shahi
Ranch Hand

Joined: Feb 06, 2005
Posts: 36
It need not be saaj.jar, but most probably it is because of some class not in sync at client and server.
Ashutosh
Rr Kumaran
Ranch Hand

Joined: Sep 17, 2001
Posts: 548
Ashutosh- thank you for all you suggestions. I shall try may be scratch again. What web services stuff are you working on ?
Ashutosh Shahi
Ranch Hand

Joined: Feb 06, 2005
Posts: 36
Well basically try to contribute to Apache Axis project and other webservices project on Apache.
Ashutosh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in custom axis (De)Serializers
 
Similar Threads
WSADIE 5.1.1 help
Help me in resolving this issue related to web service
unable to resolve exception
Cannot run AXIS 1.1 RC2 inside J2EE 1.2 complaint application server ?
Cannot run AXIS 1.1 RC2 inside J2EE 1.2 complaint application server ?