users@jaxb.java.net

Re: Plugin problem

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Wed, 17 Aug 2005 10:04:16 -0700

Patrick BRUNETON wrote:
> Hi,
>
> I have a problem to integrate a plugin with JAXB 2.0. It is a very simple
> plugin which does nothing. Problem is xjc doesn't instanciate it.
> I put my plugin in a separated jar and launch xjc with the command line :
> java -Dcom.sun.tools.xjc.Options.findServices=true -classpath
> "jaxb-ri-20050815\lib\jaxb-xjc.jar;plug.jar" com.sun.tools.xjc.XJCFacade

The way it's designed is to invoke this as:

   $ java -D... -jar jaxb-xjc.jar -cp plug.jar

Note that the -cp is used as an XJC option, not as a VM option.
XJC creates another URLClassLoader to load a plugin. If your plugin jar
has the Class-Path entry in its manifest, all those jar files will be
loaded accordingly.


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com