axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Pfeifer" <john.pfei...@hnpsolutions.com>
Subject RE: Stax API Issues on Weblogic 9
Date Tue, 29 May 2007 14:48:20 GMT
I have the stax api jars in the axis2 WEB-INF lib, the problem occurs when I remove the servlet-api-2.3.jar
from the WEB-INF/lib.  When I remove it from the WEB-INF/lib, the classloader attempts to
load classes from the webapp parent classloader (which, in turn loads the stax classes from
the weblogic class loader).   I don't think it's a good practice to bundle the servlet api
with the war file... I found this issue during cleanup.  If I leave the servlet-api jar in
the WEB-INF/lib everything works fine.

Thanks,

jp4



-----Original Message-----
From: Pal, Ravi [mailto:Pal@synygy.com]
Sent: Tue 5/29/2007 10:36 AM
To: John Pfeifer
Subject: RE: Stax API Issues on Weblogic 9
 
yes - your axis application class path.

-----Original Message-----
From: John Pfeifer [mailto:john.pfeifer@hnpsolutions.com]
Sent: Tuesday, May 29, 2007 7:52 PM
To: Pal, Ravi
Subject: RE: Stax API Issues on Weblogic 9



Do you mean add both api jars to the weblogic system classpath?

Thanks,

jp4


-----Original Message-----
From: Pal, Ravi [ mailto:Pal@synygy.com]
Sent: Tue 5/29/2007 10:22 AM
To: John Pfeifer
Subject: RE: Stax API Issues on Weblogic 9

use STAX 1 and STAX 2 in your class path, note, you would require both of them.

-----Original Message-----
From: John Pfeifer [ mailto:john.pfeifer@hnpsolutions.com]
Sent: Tuesday, May 29, 2007 7:15 PM
To: axis-user@ws.apache.org
Subject: Stax API Issues on Weblogic 9



I am running into an issue running axis2 on Weblogic 9... If I remove the servlet-api-2.3.jar
from the axis2.war file I get the following error.

 Root cause of ServletException.
     [java] java.lang.NoSuchMethodError: javax.xml.stream.XMLOutputFactory.newInstance(Ljava/lang/String;Ljava/lang/ClassLoader;)Ljavax/xml/stream/XMLOutputFactory;
     [java]     at org.apache.axiom.om.util.StAXUtils.getXMLOutputFactory(StAXUtils.java:97)
     [java]     at org.apache.axiom.om.util.StAXUtils.createXMLStreamWriter(StAXUtils.java:123)
     [java]     at org.apache.axiom.om.impl.MTOMXMLStreamWriter.<init>(MTOMXMLStreamWriter.java:74)
     [java]     at org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume(OMNodeImpl.java:410)
     [java]     at org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUsingOutputStream(CommonsHTTPTransportSender.java:275)
     [java]     Truncated. see log file for complete stacktrace


I did a bit more investigation and found that the XMLOutputFactory class in the stax-api-1.0.1.jar
file contains a method with the following signature

public static XMLOutputFactory newInstance(String factoryId, ClassLoader classLoader) throws
FactoryConfigurationError

The weblogic jar file however contains a different method signature

public static XMLInputFactory newInstance(String factoryId, ClassLoader classLoader) throws
FactoryConfigurationError


Basically, I want to cleanup the dependencies in my axis2.war file and shouldn't have to carry
around the servlet api inside the war file.  It looks like the BEA method signature above
is incorrect (why would XMLOutputFactory.newInstance() return an XMLInputFactory object?).
 Has anyone encountered this issues, if so what is the workaround?  I don't want to prepend
the stax-api jar to the system classpath unless I can be sure that it won't break anything
in Weblogic?  Suggestions would be appreciated.

Thanks,

jp4






Mime
View raw message