Build failure with JDK 1.8.0_91-b14
See original GitHub issueFollowing 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:
- Created 7 years ago
- Comments:10
Top GitHub Comments
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
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.