You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Thilo Frotscher (JIRA)" <ax...@ws.apache.org> on 2005/07/14 15:49:11 UTC

[jira] Commented: (AXIS-2121) CLONE -IncompatibleClassChangeError when deploying Axis 1.2-RC3 on WebSphere 5.1 with PARENT_FIRST classloading

    [ http://issues.apache.org/jira/browse/AXIS-2121?page=comments#action_12315832 ] 

Thilo Frotscher commented on AXIS-2121:
---------------------------------------

This was issue 1903 and reported to be fixed for Axis 1.2.1. However, using Axis 1.2.1  I get the following ClassCastException which I believe is caused by the patch:

faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode: 
 faultString: java.lang.ClassCastException: org.apache.axis.message.Text
 faultActor: 
 faultNode: 
 faultDetail: 
	{http://xml.apache.org/axis/}stackTrace:java.lang.ClassCastException: org.apache.axis.message.Text
	at org.apache.axis.message.SOAPFaultBuilder.onEndChild(Ljava.lang.String;Ljava.lang.String;Lorg.apache.axis.encoding.DeserializationContext;)V(SOAPFaultBuilder.java:309)
	at org.apache.axis.encoding.DeserializationContext.endElement(Ljava.lang.String;Ljava.lang.String;Ljava.lang.String;)V(DeserializationContext.java:1090)
	at weblogic.apache.xerces.parsers.AbstractSAXParser.endElement(Lweblogic.apache.xerces.xni.QName;Lweblogic.apache.xerces.xni.Augmentations;)V(AbstractSAXParser.java:585)
	at weblogic.apache.xerces.impl.XMLNamespaceBinder.handleEndElement(Lweblogic.apache.xerces.xni.QName;Lweblogic.apache.xerces.xni.Augmentations;Z)V(XMLNamespaceBinder.java:898)
	at weblogic.apache.xerces.impl.XMLNamespaceBinder.endElement(Lweblogic.apache.xerces.xni.QName;Lweblogic.apache.xerces.xni.Augmentations;)V(XMLNamespaceBinder.java:644)
	at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement()I(XMLDocumentFragmentScannerImpl.java:1008)
	at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Z)Z(XMLDocumentFragmentScannerImpl.java:1469)
	at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Z)Z(XMLDocumentFragmentScannerImpl.java:329)
	at weblogic.apache.xerces.parsers.DTDConfiguration.parse(Z)Z(DTDConfiguration.java:525)
	at weblogic.apache.xerces.parsers.DTDConfiguration.parse(Lweblogic.apache.xerces.xni.parser.XMLInputSource;)V(DTDConfiguration.java:581)
	at weblogic.apache.xerces.parsers.XMLParser.parse(Lweblogic.apache.xerces.xni.parser.XMLInputSource;)V(XMLParser.java:152)
	at weblogic.apache.xerces.parsers.AbstractSAXParser.parse(Lorg.xml.sax.InputSource;)V(AbstractSAXParser.java:1175)
	at weblogic.xml.jaxp.WebLogicXMLReader.parse(Lorg.xml.sax.InputSource;)V(WebLogicXMLReader.java:135)
	at weblogic.xml.jaxp.RegistryXMLReader.parse(Lorg.xml.sax.InputSource;)V(RegistryXMLReader.java:152)
	at javax.xml.parsers.SAXParser.parse(Lorg.xml.sax.InputSource;Lorg.xml.sax.helpers.DefaultHandler;)V(SAXParser.java:345)
	at org.apache.axis.encoding.DeserializationContext.parse()V(DeserializationContext.java:227)
	at org.apache.axis.SOAPPart.getAsSOAPEnvelope()Lorg.apache.axis.message.SOAPEnvelope;(SOAPPart.java:696)
	at org.apache.axis.Message.getSOAPEnvelope()Lorg.apache.axis.message.SOAPEnvelope;(Message.java:424)
	at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(Lorg.apache.axis.MessageContext;)V(MustUnderstandChecker.java:62)
	at org.apache.axis.client.AxisClient.invoke(Lorg.apache.axis.MessageContext;)V(AxisClient.java:206)
	at org.apache.axis.client.Call.invokeEngine(Lorg.apache.axis.MessageContext;)V(Call.java:2765)
	at org.apache.axis.client.Call.invoke()V(Call.java:2748)
	at org.apache.axis.client.Call.invoke(Lorg.apache.axis.message.SOAPEnvelope;)Lorg.apache.axis.message.SOAPEnvelope;(Call.java:1902)

The AxisFault you can see above is created at the end of method invoke in class AxisClient. There, a SAXException is caught and converted into an AxisFault.
The actual probem occurs in class DeserializationContext, in method parse():

                parser.parse(inputSource, this);

When this line is invoked. the SAXException is thrown, with the exception message: 

               java.lang.ClassCastException: org.apache.axis.message.Text


This issue does not exist with Axis 1.2. It only exists in Axis 1.2.1. Since the above code change was made between 1.2 and 1.2.1, 
and since variable "text" (see Description above) is now assigned an instance of  org.apache.axis.message.Text(s), this patch 
seems to be the reason for the ClassCastException. 



> CLONE -IncompatibleClassChangeError when deploying Axis 1.2-RC3 on WebSphere 5.1 with PARENT_FIRST classloading
> ---------------------------------------------------------------------------------------------------------------
>
>          Key: AXIS-2121
>          URL: http://issues.apache.org/jira/browse/AXIS-2121
>      Project: Apache Axis
>         Type: Bug
>   Components: SAAJ
>     Versions: 1.2RC3
>  Environment: WebSphere 5.1.x on Linux (2.4.x kernel).
>     Reporter: Thilo Frotscher
>     Priority: Blocker

>
> I am deploying Axis 1.2RC3 in a war that resides within an ear. The axis jars are in the war/WEB-INF/lib dir. For various reasons related to the other contents of my ear, I must use PARENT_FIRST classloading. As many have reported, if you have PARENT_FIRST classloading on WebSphere 5.1 with Axis 1.2RC3, then there is a conflict between the version of saaj (1.1) that ships with WebSphere, and the version of saaj (1.2) that Axis 1.2RC3 expects, and you get the following exception:
>  
> java.lang.IncompatibleClassChangeError: class org.apache.axis.SOAPPart does not implement interface org.w3c.dom.Document
>  
> This issue can be resolved with PARENT_LAST classloading and a manifest which specifies the classpath...but for those of use who can't use PARENT_LAST classloading, there is another option.
>  
> It appears that a single source code change to Axis will eliminate the issue altogether. The offending code is in org.apache.axis.message.MessageElement.addTextNode(), and can be patched as follows:
>  
> OLD CODE:
>  
> public SOAPElement addTextNode(String s) throws SOAPException {
>     try {
>             Text text = getOwnerDocument().createTextNode(s);
>             ((org.apache.axis.message.Text)text).setParentElement(this);
>             return this;
>         } catch (ClassCastException e) {
>             throw new SOAPException(e);
>         }
> }
>  
> PATCHED CODE:
>  
> public SOAPElement addTextNode(String s) throws SOAPException {
>     try {
>             Text text = new org.apache.axis.message.Text(s);
>             this.appendChild(text);
>             return this;
>         } catch (ClassCastException e) {
>             throw new SOAPException(e);
> }
>  
> After making this change, Axis 1.2RC3 will run on WebSphere 5.1 with PARENT_FIRST classloading, and no exceptions will be thrown.
>  
> -DT
>  
> ---------------------------------
> David Tompkins
> Sr. Computer Scientist
> Adobe Systems, Inc.
> tompkins _AT_ adobe _DOT_ com
> http://www.dt.org/

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira