I recently investigated this discrepancy between
compile-time/run-time classpaths in a message called
"Research on XSP compile-time/run-time classpaths",
but got no response.  I'm pretty sure we're dealing
with a bug here.  The only workaround I know of at
this point is the rather unpleasant $TOMCAT_HOME/lib
solution.

Here is the message I spoke of:

---

I took a look at the XSP processing code to see if I
could figure out why XSPs which compile cannot be run
due to NoClassDefFoundExceptions.  Here is what I
found.  (I am running Cocoon 1.8.2, so line numbers
correspond to that version of the sourcecode.)

Beginning in line 228 of
org.apache.cocoon.processor.xsp.XSPProcessor, an
attempt is made to determine the JSP classpath so it
can be used for XSP compilation.  It sequentially
looks through several environment values to find the
classpath; in my case, it finds it on the following
lookup:

this.servletContext.getAttribute("org.apache.tomcat.jsp_classpath")

A printout of this value shows all of my WEB-INF/lib
jars in the classpath.  In line 257, the cached
languageProcessors are each assigned this classpath. 
So far, so good.

Later on down the road, there is a request to process
my XSP.  This results in a call to the process()
method of XSPProcessor.  It attempts to compile the
XSP, and does so successfully, since the cached
languageProcessor has been initialized with the
correct classpath.  However, when it tries to load &
execute the compiled page thereafter (beginning line
523), we run into problems.  As far as I can see,
there was no resolution between the compile-time XSP
classpath and the run-time classpath.

Either I have failed to locate the code which adds
necessary jars/classes from the XSP compilation
classpath to the current runtime classpath, or there
is a bug in the code.

Does anyone know anything further about this issue? 
Can any Cocoon developers comment on this seeming
discrepancy?

--- Michael Bierenfeld
<[EMAIL PROTECTED]> wrote:
> Hi,
> 
> since tomcat does some nifty stuff while setting up
> the classpath I have
> the problem, that all my beans located in
> WEB-INF/lib are not found by
> the XSPClassLoader. They are found during
> compile-time though. Any
> workaround, solution. _Instead_ of copying them to
> $TOMCAT_HOME/lib.
> 
> Have a nice weekend
> 
> Michael
> 
>
---------------------------------------------------------------------
> Please check that your question has not already been
> answered in the
> FAQ before posting.
> <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail:
> <[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <[EMAIL PROTECTED]>
> 


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

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

Reply via email to