question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build failure with JDK 1.8.0_91-b14

See original GitHub issue

Following the tutorial on my machine (STS, JDK 1.8.0_91-b14, windows) fails with :

[INFO] — maven-jaxb2-plugin:0.12.3:generate (default) @ gs-consuming-web-service — [WARNING] The POM for org.glassfish.jaxb:jaxb-runtime:jar:2.2.11 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details [WARNING] The POM for org.glassfish.jaxb:jaxb-xjc:jar:2.2.11 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details [WARNING] Error injecting: org.jvnet.mjiip.v_2.XJC2Mojo java.lang.NoClassDefFoundError: com/sun/xml/bind/api/ErrorListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) (… snip …) Caused by: java.lang.ClassNotFoundException: com.sun.xml.bind.api.ErrorListener at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50) at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)

Upgrading the maven-jaxb2-plugin to latest version and adding jaxb dependencies fixes the issue :

    <plugin>
                <groupId>org.jvnet.jaxb2.maven2</groupId>
                <artifactId>maven-jaxb2-plugin</artifactId>
                <version>0.13.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <schemaLanguage>WSDL</schemaLanguage>
                    <generatePackage>hello.wsdl</generatePackage>
                    <schemas>
                        <schema>
                            <url>http://wsf.cdyne.com/WeatherWS/Weather.asmx?wsdl</url>
                        </schema>
                    </schemas>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>com.sun.xml.bind</groupId>
                        <artifactId>jaxb-impl</artifactId>
                        <version>2.2.11</version>
                    </dependency>
                    <dependency>
                        <groupId>com.sun.xml.bind</groupId>
                        <artifactId>jaxb-xjc</artifactId>
                        <version>2.2.11</version>
                    </dependency>
                    <dependency>
                        <groupId>com.sun.xml.bind</groupId>
                        <artifactId>jaxb-core</artifactId>
                        <version>2.2.11</version>
                    </dependency>
                </dependencies>
            </plugin>

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
apupiercommented, Jul 10, 2017

Hello @EAAR

it seems that your JAVA_HOME is pointing to a JRE and not to a JDK

M:\Program Files\Java\jdk1.8.0_121\jre

should be replaced by

M:\Program Files\Java\jdk1.8.0_121

0reactions
rmundkowskycommented, Feb 10, 2018

Thanks @apupier

I had the JDK for Eclipse set correctly for the INSTALLED JREs, so it was compiling the pom.xml in Eclipse fine. But when I ran Ant from Eclipse it was picking up the JRE that was in the PATH from where Eclipse was launched. I added JAVA_HOME to OS System ENVs and %JAVA_HOME%\bin to the front of the PATH and that fixed it. Wow, otherwise I would have been playing with dependencies thinking one of them had changed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Known Issues for JDK 8 - Oracle
If an applet requests version 1.8 in a JNLP file or an HTML applet tag, then the applet fails or loads resources for...
Read more >
Cordova : Requirements check failed for JDK 1.8 or greater
Yes i am able to run the build command with this, but still struggling with the run command 'ionic cordova run android', showing...
Read more >
How to force JDK 1.8 compliance in a Maven POM example
Even with recent releases like Eclipse Photon, tasks such as importing Maven projects or creating anything more than a basic Maven project is ......
Read more >
JDK Configuration for Maven Build in Eclipse - Baeldung
Learn how to configure Maven builds to work within the Eclipse IDE. ... The error message indicates that Maven is unable to find...
Read more >
Requirements check failed for JDK 8 ('1.8.*')! Detected version ...
Information. cordova create hello com.example.hello HelloWorld; cd hello; cordova platform add android@9.0.0; cordova build android ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found