-
Notifications
You must be signed in to change notification settings - Fork 100
Bad pom dependencies lead to java.lang.NoClassDefFoundError: com/sun/xml/bind/api/ErrorListener #1070
Comments
Reported by chengas123 |
Was assigned to yaroska |
yaroska said: From poms I see that: |
chengas123 said: Also, com.sun.xml.bind:jaxb-xjc only optionally depends on org.glassfish.jaxb:jaxb-xjc, so it's not going to pull it in. I don't think it should even have an optional dependency though. An optional dependency is typically used if com.sun.xml.bind:jaxb-xjc had code referencing classes from org.glassfish.jaxb:jaxb-xjc because you wanted to provide some extra features for it or something, but didn't want to force everyone to pull that jar into their project since only some people would use it. However, in this case, there seems to be no reference at all to any classes in that jar even for optional functionality, so it'd be better to just remove that dependency entirely. Most build systems can show the dependency graph. E.g. if you use gradle you can run "gradle dependencies" Here's the dependency graph with 2.2.7: runtime - Runtime classpath for source set 'main'. Here's the dependency graph with 2.2.11: runtime - Runtime classpath for source set 'main'. |
yaroska said: The old one 'com.sun.xml.bind' shouldn't be used. It exists only for building legacy jaxb-ri.zip bundle. Here is current dependency tree for JAXB runtime: [INFO] — maven-dependency-plugin:2.8:tree (default-cli) @ jaxb-runtime — |
This issue was imported from java.net JIRA JAXB-1070 |
Running jaxb-xjc bombs out because there's no dependency declared on jaxb-core
More info here:
scubacabra/gradle-jaxb-plugin#15
Affected Versions
[2.2.11]
The text was updated successfully, but these errors were encountered: