Bug 157757 - Cannot create NB module that uses JAXB
Cannot create NB module that uses JAXB
Status: NEW
Product: platform
Classification: Unclassified
Component: -- Other --
6.x
All All
: P3 (vote)
: TBD
Assigned To: issues@platform
issues@platform
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-02 10:48 UTC by kitfox
Modified: 2009-02-03 08:57 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kitfox 2009-02-02 10:48:53 UTC
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
error like:

java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
	at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:253)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Caused: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
	at com.kitfox.tw.TileLayoutPanel.<init>(TileLayoutPanel.java:70)
	at com.kitfox.source.SourceLayoutPanel.<init>(SourceLayoutPanel.java:32)
	at com.kitfox.source.SourceGridView.<init>(SourceGridView.java:34)
	at com.kitfox.nb.source.SourceVisualView.createElement(SourceVisualView.java:109)
	at org.netbeans.core.multiview.MultiViewModel.getElementForDescription(MultiViewModel.java:206)
	at org.netbeans.core.multiview.MultiViewModel.getActiveElement(MultiViewModel.java:127)


What can I do to use JAXB in my module?
Comment 1 kitfox 2009-02-03 04:26:40 UTC
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.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo