I'm writing a module for NetBeans so that I can conveniently edit a custom XML file with a visual interface in the
NetBeans environment. Most of the the code for encapsulating, visualizing and mutating my file is stored in an ordinary
JAR file built in a regular NB library project. I've then wrapped it in a module wrapper and added it to my module
suite. I've also added a second module to my suite which creates the DataObjects, ClonableEditorSupports and other
things I would need to see it within the NB environment.
Unfortunately, my library uses JAXB to marshal my XML to and from its 'live' form - and according to bug 96711, this is
problematic. I am using JDK 6 and have set the source level of both modules to version 1.6. I've also included the
JAX-WS dependency for both modules, but am still unable to run. Whenever any attempt is made to use JAXB, I get an
Caused: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
What can I do to use JAXB in my module?
Okay, I found a work around:
1) Right click on the project of the wrapped module and select Properties
2) Select Libraries/Add Dependency... Check Non API Modules and scroll down to JAXB 2.1 library. Press OK
3) Highlight the JAXB 2.1 Library entry in Module Dependencies and press Edit...
4) Select Implementation Version
After doing all this, JAXB seems to work. However, the IDE issues warnings about incompatibilities during startup.
JAXB is now a standard part of the JDK, and it would be nice if this process of integrating it into a module could made
much cleaner and intuitive.