abdera-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bas de Bakker (JIRA)" <j...@apache.org>
Subject [jira] [Created] (ABDERA-314) In OSGi, parser bundle cannot use StAX
Date Mon, 14 Jan 2013 16:00:14 GMT
Bas de Bakker created ABDERA-314:
------------------------------------

             Summary: In OSGi, parser bundle cannot use StAX
                 Key: ABDERA-314
                 URL: https://issues.apache.org/jira/browse/ABDERA-314
             Project: Abdera
          Issue Type: Bug
    Affects Versions: 1.1.3
            Reporter: Bas de Bakker


This issue refers to a version 1.1.3 dated December 21, 2012 on the Apache mirrors. The mailing
lists only mention an 1.1.3 RC2, so I'm not sure if this version is meant to be the final
release version of 1.1.3.

I'm trying to use Abdera in an OSGi based server. However, this fails with stacktraces like:

javax.xml.stream.FactoryConfigurationError: Requested factory com.ctc.wstx.stax.WstxOutputFactory
cannot be located.  Classloader =sun.misc.Launcher$AppClassLoader@42b7141a
        at javax.xml.stream.FactoryLocator.loadFactory(FactoryLocator.java:120) ~[na:na]
        at javax.xml.stream.FactoryLocator.locate(FactoryLocator.java:109) ~[na:na]
        at javax.xml.stream.FactoryLocator.locate(FactoryLocator.java:54) ~[na:na]
        at javax.xml.stream.XMLOutputFactory.newInstance(XMLOutputFactory.java:29) ~[na:1.7.0_11]
        at org.apache.axiom.om.util.StAXUtils$9.run(StAXUtils.java:655) ~[na:na]
        at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_11]
        at org.apache.axiom.om.util.StAXUtils.newXMLOutputFactory(StAXUtils.java:645) ~[na:na]
        at org.apache.axiom.om.util.StAXUtils.getXMLOutputFactory_perClassLoader(StAXUtils.java:709)
~[na:na]
        at org.apache.axiom.om.util.StAXUtils.getXMLOutputFactory(StAXUtils.java:348) ~[na:na]
        at org.apache.axiom.om.util.StAXUtils.getXMLOutputFactory(StAXUtils.java:313) ~[na:na]
        at org.apache.axiom.om.util.StAXUtils.createXMLStreamWriter(StAXUtils.java:436) ~[na:na]
        at org.apache.axiom.om.util.StAXUtils.createXMLStreamWriter(StAXUtils.java:431) ~[na:na]
        at org.apache.axiom.om.impl.llom.OMSerializableImpl.serialize(OMSerializableImpl.java:149)
~[na:na]
        at org.apache.abdera.parser.stax.FOMElement.writeTo(FOMElement.java:341) ~[na:na]
        at org.apache.abdera.parser.stax.FOMWriter.writeTo(FOMWriter.java:73) ~[na:na]
        at org.apache.abdera.util.AbstractWriter.writeTo(AbstractWriter.java:80) ~[na:na]
        at org.apache.abdera.parser.stax.FOMElement.writeTo(FOMElement.java:314) ~[na:na]
        at org.apache.abdera.parser.stax.FOMElement.writeTo(FOMElement.java:329) ~[na:na]

As Java includes StAX since version 6, I don't need Woodstox. So what I did was:
1. Remove the geronimo-stax_api and wstx-asl jars from the abdera-parser bundle
2. Remove them from the Bundle-ClassPath manifest header
3. Add javax.xml.stream and javax.xml.stream.util to its Import-Package header
This fixed the issue for me.

I would suggest doing the above. Anyone still using an ancient Java version without StAX can
include it as an external dependency.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message