Error in Maven and JAXB

I wrote a small Java program using JAXB. Works fine in Eclipse! Everthing works ...

Then I enabled Maven and when I execute the Jar (generated by Maven) I get the following error:

Dez 16, 2014 2:51:15 PM com.sun.xml.internal.bind.v2.util.XmlFactory createParserFactory
SCHWERWIEGEND: null
org.xml.sax.SAXNotRecognizedException: http://javax.xml.XMLConstants/feature/secure-processing
        at org.apache.xerces.parsers.AbstractSAXParser.setFeature(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserImpl.setFeatures(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserImpl.<init>(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParserImpl(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserFactoryImpl.setFeature(Unknown Source)
        at com.sun.xml.internal.bind.v2.util.XmlFactory.createParserFactory(Unknown Source)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.getXMLReader(Unknown Source)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(Unknown Source)
        at javax.xml.bind.JAXB.unmarshal(Unknown Source)
        at de.lsd.jimp.controller.JImpController.doJAXB(JImpController.java:70)
        at de.lsd.jimp.controller.JImpController.<init>(JImpController.java:46)
        at de.lsd.jimp.init.JImp.initController(JImp.java:195)
        at de.lsd.jimp.init.JImp.main(JImp.java:219)

ERROR [2014-12-16 14:51:15,626] - Fehler bei JAXB.unmarshal aufgetreten! Thread:main Class:de.lsd.jimp.controller.JImpController Method:doJAXB
java.lang.IllegalStateException: org.xml.sax.SAXNotRecognizedException: http://javax.xml.XMLConstants/feature/secure-processing
        at com.sun.xml.internal.bind.v2.util.XmlFactory.createParserFactory(Unknown Source)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.getXMLReader(Unknown Source)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(Unknown Source)
        at javax.xml.bind.JAXB.unmarshal(Unknown Source)
        at de.lsd.jimp.controller.JImpController.doJAXB(JImpController.java:70)
        at de.lsd.jimp.controller.JImpController.<init>(JImpController.java:46)
        at de.lsd.jimp.init.JImp.initController(JImp.java:195)
        at de.lsd.jimp.init.JImp.main(JImp.java:219)
Caused by: org.xml.sax.SAXNotRecognizedException: http://javax.xml.XMLConstants/feature/secure-processing
        at org.apache.xerces.parsers.AbstractSAXParser.setFeature(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserImpl.setFeatures(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserImpl.<init>(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParserImpl(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserFactoryImpl.setFeature(Unknown Source)

      

My POM file looks like this:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>JImp</groupId>
    <artifactId>JImp</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <build>
        <sourceDirectory>src</sourceDirectory>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <mainClass>de.own.jimp.init.JImp</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.5</version>
        </dependency>
        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
            <version>3.2</version>
        </dependency>
        <dependency>
            <groupId>commons-configuration</groupId>
            <artifactId>commons-configuration</artifactId>
            <version>1.2</version>
        </dependency>
        <dependency>
            <groupId>commons-digester</groupId>
            <artifactId>commons-digester</artifactId>
            <version>2.1</version>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.1</version>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.9</version>
        </dependency>
        <dependency>
            <groupId>ownSWT64</groupId>
            <artifactId>ownSWT64</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
            <groupId>ownJFace</groupId>
            <artifactId>ownJFace</artifactId>
            <version>3.8.102</version>
        </dependency>
        <dependency>
            <groupId>ownOjdbc</groupId>
            <artifactId>ownOjdbc</artifactId>
            <version>14</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.core</groupId>
            <artifactId>runtime</artifactId>
            <version>3.10.0-v20140318-2214</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.core</groupId>
            <artifactId>commands</artifactId>
            <version>3.3.0-I20070605-0010</version>
        </dependency>
        <dependency>
            <groupId>revofubi</groupId>
            <artifactId>revofubi</artifactId>
            <version>1.0.0</version>
        </dependency>
    </dependencies>
</project>

      

I figured it was a Maven-caused issue (in Eclipse this works ..). Further I read that this problem is caused by integral dependencies ?!

I cannot work it out.

You may have experience with this problem ..!

Thanks for the help!

+3


source to share





All Articles