JAXB marshalling exception javax.xml.stream.FactoryConfigurationError running with Java 5
Asked Answered
L

1

3

I am trying a simple JAXB marshaling in my JUit test class and I am using Java 5. I get this error while running the test.

javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.XMLOutputFactoryBase not found

I have added the following dependencies in my pom.

     <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>2.2</version>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-xjc</artifactId>
        <version>2.2</version>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
        <version>2.2</version>
    </dependency>
    <dependency>
        <groupId>javax.xml</groupId>
        <artifactId>jsr173</artifactId>
        <version>1.0</version>
    </dependency>
    <dependency>
       <groupId>javax.activation</groupId>
       <artifactId>activation</artifactId>
       <version>1.1</version>
    </dependency>

any help on this issue is highly appreciated.

Loathe answered 21/2, 2012 at 3:19 Comment(0)
R
3

From the dependency list above, it looks like you are using jsr173 - steaming API for XML. The dependency you have specified just provides the API. You need to add a provider which implements this. The default provider that it looks for, if it does not find any is the bea implementation. Hence the error.

Here is a discussion on this. You could add the bea implementation or alternate ones like woodstox.

Radiolucent answered 21/2, 2012 at 5:19 Comment(2)
Link that helped When I added the stax dependency, I was able ti run the tests with jaxbLoathe
Thanks Raghuram for the reply I believe that the required implementation is bundled with stax dependency.Loathe

© 2022 - 2024 — McMap. All rights reserved.