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

Reply via email to