users@jaxb.java.net

CLASSPATH and bindings with existing classes?

From: David Byrden <David_at_BYRDEN.COM>
Date: Tue, 31 Dec 2002 12:55:40 -0700

I want to use some existing classes in my binding, for example I have:

 <jaxb:javaType name='java.net.URL'
    parse='URLConverter.toURL'
    print='URLConverter.toString'
 />

Therefore my class 'URLConverter' is used by the generated binding code, and it must be present when the binding is compiled; but how can I tell the XJC compiler where I've put it??? It gives me a NoClassDefFoundError.

XJC xeems to have no options for setting its classpath. The classpath of the DOS shell from which I run XJC is ignored.

I tried modifying the XJC.BAT script to set the -classpath option in the JAVA command that runs the binding compiler. Since THAT makes no difference, I assume XJC makes an internal ClassLoader and does NOT hang it under the system loader.

Right now the only workaround that I know is to zip up my URLConverter and other classes, and install the zip as an extension (place it in the ext folder). This is not a long-term solution!

Does anyone know a CLASSPATH option to XJC that's not in the documentation?
David