The Source for Java Technology Collaboration
User: Password:



Kirill Grouchnikov

Kirill Grouchnikov's Blog

New version of JAXB 2.1 Eclipse plugin

Posted by kirillcool on September 05, 2006 at 08:39 PM | Comments (3)

Not a lot of you may be aware of this, but i'm a community lead in the Web Services & XML community right here on java.net. Mainly i'm responsible for updating the main page with the relevant news / weblogs / technical articles, but i also have a JAXB Workshop project that provides a collection of JAXB 2.0 related tools. This project has been largely dormant during the past year except the Eclipse and IDEA plugins. The Eclipse plugin provides a wizard for selecting the input schema, location for the generated files and the package name. After all the parameters have been selected, it invokes the XJC generator and that's pretty much it.

One of the things that have been missing from this wizard - an option to cancel it in the middle, which is quite a common feature for Eclipse wizards. I've filed the relevant issue on the JAXB tracker about six months ago, and once Kohsuke announced the beginning of version 2.1, all i needed was to give him a little push (read the comments on the linked entry). After taking the daily build and making changes to 4 (!!!) lines of code in the Eclipse plugin, now it's cancellable! Thanks to Kohsuke for adding this feature in JAXB 2.1 and to Eclipse engineers for making plugin development in Eclipse such a pleasurable experience.

The second feature that has been added is logging to Eclipse's own console (instead of to the System.out) - this has been requested by one of the users. All i had to do is input "eclipse console" to Google and come up with this link - thanks, Jevon.

So, if you need to generate classes from your schema definition, you can either write a little script, or head over here, download the Eclipse plugin 1.1, unzip it under Eclipse 3.1.0+ installation and follow the instructions in the tutorial.


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • No joy for those of us who've migrated to Eclipse 3.2 ?

    Posted by: hartsock on September 22, 2006 at 08:41 AM

  • What joy are you talking about? This plugin has been developed for Eclipse 3.1 and if it doesn't run under 3.2, then most probably one of the relevant APIs has been changed and if i change the plugin then it won't run under 3.1.

    Posted by: kirillcool on September 22, 2006 at 08:52 AM

  • Look in your workspace directory, there is a folder named .metadata. Inside this folder is a log file named .log. If you check this log you should see the following: java.lang.ClassNotFoundException: org.jvnet.jaxbw.eclipse.popup.actions.RunXjcAction The plugin can't find this class so the exception bubbles up to a lovely client side message "The chosen operation is not available". Go into eclipse's plugin folder and find a jar named jaxbw-eclipse.jar in org.jvnet.jaxbw.eclipse_1.1.0 folder. Copy the jar into the plugin directory. Now eclipse can find the class. After this I was able to right click on an XSD file and choose to Run XJC which created JAXB objects. I just installed and got this plugin to run today. However if anyone has any questions on this email me at apothmus@hotmail.com and I'll see if I can help. I have noticed that it will only generate off one XSD file at a time which is unfortunate.

    Posted by: xanthros on October 25, 2007 at 02:28 PM





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds