NOTE: This article is 3 years or older so its information may no longer be relevant. Read on at your own discretion! Comments for this article have automatically been locked, refer to the FAQ
for more details.
I've recently had to use a different JAX-WS library for some development work on a project, which worked great by placing all the jar files into the Java Extensions directory, however when I went back to trying to compile another project I had, everything started to break, I was getting exceptions I have never seen before. After a bit of investigation, it turned out that the NetBeans JAXB libraries do no like being mixed with the JAX-WS libraries. The fix is simple, remove the 3rd party libraries from the Extensions directory.
This is the error I was getting:
/xxx/nbproject/build-impl.xml:582: The following error occurred while executing this line:
/xxx/nbproject/build-impl.xml:1061: The following error occurred while executing this line:
/xxx/nbproject/xml_binding_build.xml:8: typedef A class needed by class com.sun.tools.xjc.XJCTask cannot be found: org/apache/tools/ant/DynamicConfigurator
using the classloader AntClassLoader[/Applications/NetBeans/NetBeans 7.1.2.app/Contents/Resources/NetBeans/ide/modules/ext/jaxb/jaxb-impl.jar:/Applications/NetBeans/NetBeans 7.1.2.app/Contents/Resources/NetBeans/ide/modules/ext/jaxb/activation.jar:/Applications/NetBeans/NetBeans 7.1.2.app/Contents/Resources/NetBeans/ide/modules/ext/jaxb/jaxb1-impl.jar:/Applications/NetBeans/NetBeans 7.1.2.app/Contents/Resources/NetBeans/ide/modules/ext/jaxb/jaxb-xjc.jar:/Applications/NetBeans/NetBeans 7.1.2.app/Contents/Resources/NetBeans/ide/modules/ext/jaxb/api/jaxb-api.jar:/Applications/NetBeans/NetBeans 7.1.2.app/Contents/Resources/NetBeans/ide/modules/ext/jaxb/api/jsr173_api.jar]
BUILD FAILED (total time: 0 seconds)
When I checked the Extensions directory of course these were the culprits:
FastInfoset.jar jaxb-impl.jar jsr173_api.jar policy.jar streambuffer.jar
activation.jar jaxb-xjc.jar jsr181-api.jar resolver.jar woodstox.jar
gmbal-api-only.jar jaxws-api.jar jsr250-api.jar saaj-api.jar
http.jar jaxws-rt.jar management-api.jar saaj-impl.jar
jaxb-api.jar jaxws-tools.jar mimepull.jar stax-ex.jar
Simply moving these out fixed the issue.
A quick disclaimer...
Although I put in a great effort into researching all the topics I cover, mistakes can happen.
If you spot something out of place, please do let me know.
All content and opinions expressed on this Blog are my own and do not represent the opinions of my employer (Oracle).
Use of any information contained in this blog post/article is subject to this disclaimer
Other posts you may like...