Yesterday we faced similar problem (com.sun.tools.javac.Main not found 
when compiling java files with maven). My colleague told me that it was solved
by reinstallation of jdk and maven. Sorry don't know details.

Thanks,
Alexey

----- Original Message ----- 
From: "Shields, John (HQP)" <[EMAIL PROTECTED]>
To: "'Webb Morris'" <[EMAIL PROTECTED]>; "Maven Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, March 02, 2004 4:27 AM
Subject: RE: NullPointerException Running JAX-RPC wscompile/wsdeploy AntTa s ks


> I have already added tools.jar to my Maven repository and made a dependency
> on it to no avail. But I do think that that may need to stay there, though.
> 
> I think the main problem is the JWSDP relies on calling
> Thread.currentThread().getContextClassLoader() to get a reference to an
> appropriate ClassLoader. It seems that the thread context ClassLoader is
> often null for the ant tasks. I don't understand why that happens???
> 
> I see that line 439 of "PluginManager.java" (in the Maven sources I have)
> sets the thread context classloader to null. Why is that done?
> 
> I think that's the problem, but I'd like to understand why that is done.
> 
> Cheers,
> 
> John
> 
> 
> -----Original Message-----
> From: Webb Morris [mailto:[EMAIL PROTECTED] 
> Sent: Monday, March 01, 2004 5:01 PM
> To: Maven Users List
> Subject: RE: NullPointerException Running JAX-RPC wscompile/wsdeploy AntTa s
> ks
> 
> John,
> 
> I believe I follow, but hopefully someone else is paying attention to our
> thread and will be able
> to offer better answers than the ones I'm about to give you:
> 
> 0. I don't think so, see 1.
> 
> 1. I don't know. I don't know. ;)
> 
> 2. I'm away from my projects, but I'll be able to check for sure tomorrow. I
> know that I've come
> across a problem where tools.jar was not included in the class loader that I
> needed for it to be
> in, but I can't remember the exact situation. I do remember that in order to
> work around this
> problem, I faked tools.jar in the repository (under something like
> java/jars/tools-1.4.jar) and
> added it as a dependency. Gross, I know, but it worked. I've been meaning to
> revisit this, just
> haven't gotten around to it, yet.
> 
> I'll actually be working on a JAX-RPC project tomorrow, so I'll let you know
> what kind of
> wackiness I encounter.
> 
> Hope this helps,
> 
> WM
> 
> 
> --- "Shields, John (HQP)" <[EMAIL PROTECTED]> wrote:
> > Webb,
> > 
> > Thanks for the tip. Your suggestion prompted me to write a quick test case
> > to print out the ClassLoader hierarchy for the pertinent classes. The
> output
> > is created by calling ClassLoader.getParent() in a loop. Here is the
> output:
> > 
> > Thread Classloader1: [EMAIL PROTECTED]
> > Thread Classloader2: [EMAIL PROTECTED]
> > Thread Classloader3: [EMAIL PROTECTED]
> > Boot Classloader1: [EMAIL PROTECTED]
> > Javac Classloader1: [ForeheadClassLoader: name="root"]
> > Javac Classloader2: [ForeheadClassLoader: name="$forehead-root$"]
> > Javac Classloader3: [EMAIL PROTECTED]
> > Javac Classloader4: [EMAIL PROTECTED]
> > Compiler Helper Classloader1: [EMAIL PROTECTED]
> > Compiler Helper Classloader2: [EMAIL PROTECTED]
> > Compiler Helper Classloader3: [EMAIL PROTECTED]
> > 
> > In the JWSDP, there is a class called JavaCompilerHelper that uses the
> > thread context ClassLoader to load "com.sun.tools.javac.Main". As you can
> > see from the output above, "...javac.Main" is in a sibling ClassLoader of
> > the AntClassLoader which is the thread context ClassLoader. Thus, I think
> > the JWSDP ant tasks just can't see tools.jar because they are in a sibling
> > ClassLoader, not a child one. So...
> > 
> > 0. Am I missing something???
> > 
> > 1. Why is the AntClassLoader a sibling of the ForeheadClassLoader and not
> a
> > child? Is there a way to change that?
> > 
> > 2. How do I get tools.jar into the AntClassLoader?
> > 
> > Thanks!
> > 
> > John



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to