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:
> Greg Merrill wrote:
> > 
> > Does XSP use a different classpaths at
> compile-time
> > and run-time? The reason I ask is because I'm
> seeing
> > the following strange behavior:
> > 
> > I have an XSP which imports/uses some utility
> classes
> > which live in a jar file within my war's
> WEB-INF/lib.
> > When I access this XSP, it compiles just fine.  I
> can
> > go to the repository & see both the .java and
> .class
> > file.
> > 
> > However, when the XSP processor attempts to *run*
> the
> > compiled XSP, I get a NoClassDefFoundError; the
> > message cites my utility class (remember, this
> lives
> > in a jar in WEB-INF/lib) as the class which can't
> be
> > located.
> > 
> > Has anyone seen behavior like this before?  I'm
> > running JBoss w/embedded Tomcat.
> 
> *gg* I am experiencing the same problems. must be
> the weather or some
> solar activity related phenomen.
> 
> Regards
> 
> 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