You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by David Tompkins <to...@adobe.com> on 2005/03/24 19:17:32 UTC

A solution to deploy Axis 1.2 on WebSphere 5.1 with PARENT_FIRST classloading...

Greetings,
 
I know that deploying Axis 1.2 on WebSphere 5.1 has been a frequent topic on
this list, so I thought I would add my findings to the noise.
 
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.
 
After some digging in the Axis code, 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);
            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

Re: A solution to deploy Axis 1.2 on WebSphere 5.1 with PARENT_FIRST classloading...

Posted by Davanum Srinivas <da...@gmail.com>.
Can you please log a bug report?

thanks,
dims


On Thu, 24 Mar 2005 10:17:32 -0800, David Tompkins <to...@adobe.com> wrote:
>  
> Greetings, 
>   
> I know that deploying Axis 1.2 on WebSphere 5.1 has been a frequent topic on
> this list, so I thought I would add my findings to the noise. 
>   
> 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. 
>   
> After some digging in the Axis code, 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);
>             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 


-- 
Davanum Srinivas - http://webservices.apache.org/~dims/

Re: A solution to deploy Axis 1.2 on WebSphere 5.1 with PARENT_FIRST classloading...

Posted by Davanum Srinivas <da...@gmail.com>.
Can you please log a bug report?

thanks,
dims


On Thu, 24 Mar 2005 10:17:32 -0800, David Tompkins <to...@adobe.com> wrote:
>  
> Greetings, 
>   
> I know that deploying Axis 1.2 on WebSphere 5.1 has been a frequent topic on
> this list, so I thought I would add my findings to the noise. 
>   
> 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. 
>   
> After some digging in the Axis code, 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);
>             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 


-- 
Davanum Srinivas - http://webservices.apache.org/~dims/