vendredi 23 août 2019

Maven surefire shows an error java.lang.ClassNotFoundException: org.apache.xmlbeans.XmlObject

Everywhere it says that the error is due to the lack of xmlbeans, but it is indicated in my dependencies.

[ERROR] script3(script_1_2_3.TestScripts)  Time elapsed: 33.818 s  <<< ERROR!
java.io.IOException: org/apache/xmlbeans/XmlException
       at script_1_2_3.TestScripts.script3(TestScripts.java:84)
Caused by: java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlException
       at script_1_2_3.TestScripts.script3(TestScripts.java:84)
Caused by: java.lang.ClassNotFoundException: org.apache.xmlbeans.XmlException
       at script_1_2_3.TestScripts.script3(TestScripts.java:84)

Here is a complete list of these apache.poi dependencies from the POM file.

            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>4.1.0</version>

            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>4.1.0</version>

            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml-schemas</artifactId>
            <version>4.1.0</version>

            <groupId>org.apache.poi</groupId>
            <artifactId>ooxml-schemas</artifactId>
            <version>1.4</version>

            <groupId>org.apache.xmlbeans</groupId>
            <artifactId>xmlbeans</artifactId>
            <version>3.1.0</version>

            <groupId>org.apache.poi</groupId>
            <artifactId>poi-scratchpad</artifactId>
            <version>4.1.0</version>

Also, before starting the tests, warning messages appear that apply to all poi packages, but the tests run.

[WARNING] The POM for org.apache.poi: poi:jar:4.1.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.apache.poi: poi-ooxml:jar:4.1.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.apache.poi: poi-ooxml-schemas:jar:4.1.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.apache.xmlbeans:xmlbeans:jar:3.1.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.apache.poi: poi-scratchpad:jar:3.9 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.apache.poi: openxml4j:jar:1.0-beta is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details

Aucun commentaire:

Enregistrer un commentaire