Hello,

 I am trying to compile a jsp page which contains references to classes
loaded in memory (not on physical location): i.e. I have my classes in my
Thread.currentThread.getContextClassLoader.

I tried to mimic what the JspServlet is doing. 
After setting my classloader:

ClassLoader cl = {code to get a specific classloader containing the classes
I want}
Thread.currentThread().setContextClassLoader(cl);


I created a JspRuntimeContext (which initializes its classloader to the
current thread’s classloader).
new JspRuntimeContext(context, options); 


When I create a JspServletWrapper for my jsp, The JspRuntimeContext that I
created above will pass it’s classloader to the JspCompilationContext inside
the JspServletWrapper object. 

I browsed through the code, it seems JDTCompiler will make use of the
classloader of the JspCompilationContext that initialized it. 

So, theoretically, when it will compile my jsp page, it should not fail,
since, although the .class files are not in physical locations on the disk,
they are already loaded by the classloader. 

However, it just doesn’t work. It only works when I put the .class files in
physical locations.

I do not know if I am missing anything, but is there a way to twist the
JDTCompiler to read dependencies form the classloader the way I am intending
to do?

Thanks a lot, 

-- 
View this message in context: 
http://www.nabble.com/JDTCompiler-and-Classloading-issues-tp14734119p14734119.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to