users@glassfish.java.net

Re: Stax API Conflict

From: Bhakti Mehta <Bhakti.Mehta_at_Sun.COM>
Date: Wed, 17 Oct 2007 15:29:06 -0700

Are you using JDK 6? Stax is already integrated in JDK 6 so in that case
the only way to override it is using endorsed standards, one way is
copying the new stax-api jar to $JAVA_HOME/jre/lib/endorsed?
Regards,
Bhakti

allen_a_george wrote:
> Hi,
>
> I'm trying to deploy a war generated using Apache Muse. Apache Muse relies
> on Axis2. The generated .war bundles all the Axis2 jars, xml parsers, StaX
> apis etc. that the application would use. However, when invoking the web
> app, I get the following error:
>
> description: The server encountered an internal error () that prevented it
> from fulfilling this request.</p>
> exception javax.servlet.ServletException: PWC1244: Servlet execution threw
> an exception
> root cause
>
> java.lang.NoSuchMethodError:
> javax.xml.stream.XMLOutputFactory.newInstance(Ljava/lang/String;Ljava/lang/ClassLoader;)Ljavax/xml/stream/XMLOutputFactory;
>
> Reading around, I _think_ this is because the Java EE 5 RI uses the StaX 1.0
> API, which has a different (buggy) signature for this method.
>
> I would like to have my deployed web application use the locally bundled,
> i.e. in WEB-INF/lib/, parsers and other implementation classes. How would I
> do this?
>
> Notes:
> I thought I could do this by setting <delegate="false"/> in sun-web.xml, but
> that didn't work out...
>
> Thanks,
> Allen
>