users@jaxb.java.net

Re: Strange plugin problem

From: Kohsuke Kawaguchi <kohsuke.kawaguchi_at_sun.com>
Date: Mon, 06 Jun 2005 20:46:58 -0400

Aleksei Valikov wrote:
> I've started HyperJAXB 2

Cool!! Yay!!


> I've written a couple of plugins that generate equals(...) and
> hashCode() methods.

That already is very useful for many people. Any plan to make it available?



> After several hours of digging, seems like I've found what the source of
> the problem is. XJCTask uses ParallelWorldClassLoader which seems to
> conflict with Ant's classloader.
> For now, I simply disabled ParallelWorldClassLoader for 2.0:
> cl = XJCTask.class.getClassLoader();
> // cl = new
> // ParallelWorldClassLoader(XJCTask.class.getClassLoader(),source);
> driver = cl.loadClass("com.sun.tools.xjc.XJC2Task");
>
> And it works. I don't know what exactly the conflict is and what the
> whole idea behind this ParallelWorld was, but it functions now, with ant
> and plugins.

I'm sorry that the classloaders caused a lot of trouble to you.

It's really a bug that 2.0 uses a ParallelWorldClassLoader. It's only
needed to load XJC 1.0 classes, and that's strictly for backward
compatibility reason.

I'll apply your fix to the source code.

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com