cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: servlet.jar question (was Re: [c2] can't start cocoon)
Date Wed, 07 Mar 2001 19:40:00 GMT
dima berastau wrote:
> 
>  Yep, that fixes the problem. Without this addition to the web.xml file,
> latest CVS of Tomcat 4.0 just keeps throwing "not a servlet" exception on
> Cocoon 2.
> 
>  Can anyone explain why?
> 
>  I mean I build both Tomcat 4.0 and Cocoon 2 with exactly the same
> servlet.jar (2.3) in the classpath and it still throws that exception
> unless I modify the web.xml as suggested by Colin.

It has to do with compiling the Sitemap and XSP pages.  The Java Compiler
is designed for yester-year needs--pure command line opperation, never
invoked routinely for self-compilation.

What this means is there is no way the Compiler can use the ClassLoader
to compile against--you have to have an explicit classpath in text to
pass to the compiler.  There are serveral ways around this:

* Use proprietary Context variables that servlet engines use.  We started
  out this way, but you have to search documentation or jar files for the
  answer--even then, it is not guaranteed to be visible to you.

* Have the user enter the entire classpath in an init-parameter.  This is
  clearly not user friendly.

* Calculate the classpath from standard servlet specs.  This is our current
  approach.  However, the caviat is that you are still subject to the whims
  of the Servlet Engine vendor.  We have a couple of workarounds for this:
  extra-classpath (for jars that are not in the system classpath or the
  WEB-INF heirarchy), lib-dir and classes-dir (for servlet engines that
  move your jars on you).

Servlet 2.3 spec states that each context is completely separate from each
other.  That means that only the Servlet classes are added to your ClassLoader
as needed.  This is great for normal secure operation, but this is bad
for compilation.

So far, JSP and Cocoon are the only two types of servlets that require
compilation.  JSP is highly implementation dependant, and Servlet vendors
can cheat on how to incorporate things.  Cocoon is a well-behaved servlet
that has some complex needs.

> 
> thanks,
> dima
> 
> On Tue, 6 Mar 2001, Colin Britton wrote:
> 
> > To make C2 work with Catalina (current CVS not B1) you need to add the
> > following to the cocoon web.xml
> >
> >   <init-param>
> >        <!-- change param value to path to Catalina's servlet.jar -->
> >       <param-name>extra-classpath</param-name>
> >
> > <param-value>D:\xml_technology\jakarta-tomcat-4.0\common\lib\servlet.jar</pa
> > ram-value>
> >     </init-param>
> >
> > rgds
> > CB
> >
> > ----- Original Message -----
> > From: "Donald Ball" <balld@webslingerZ.com>
> > To: <cocoon-dev@xml.apache.org>
> > Sent: Tuesday, March 06, 2001 4:02 PM
> > Subject: [c2] can't start cocoon
> >
> >
> > > heya. just giving the latest c2 a whirl to take a look at berin's actions
> > > in real life. unfortunately, i get the sitemap's handler is not available
> > > error (the c2 catchall error, it would seem). running with catalina fresh
> > > from cvs. yes, i nuked the cocoon working directory. :). the error is:
> > >
> > > 2001-03-06 15:45:20 ERROR   24043   [cocoon  ] (Thread-6): Error compiling
> > > sitemap
> > > org.apache.cocoon.components.language.LanguageException: Error compiling
> > > sitemap_xmap:
> > > Line 0, column 0:
> > >
> > /home/balld/src/jakarta-tomcat-4.0/build/work/localhost/cocoon/org/apache/co
> > coon/www/_/home/balld/src/jakarta_tomcat_4_0/build/webapps/cocoon/sitemap_xm
> > ap.java:21:
> > > Class javax.servlet.http.HttpServletRequest not found in import.
> > > import javax.servlet.http.HttpServletRequest;
> > >        ^
> > >
> > >         at
> > >
> > org.apache.cocoon.components.language.programming.java.JavaLanguage.compile(
> > JavaLanguage.java:201)
> > >         at
> > >
> > org.apache.cocoon.components.language.programming.CompiledProgrammingLanguag
> > e.load(CompiledProgrammingLanguage.java:132)
> > >         at
> > >
> > org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.generat
> > eResource(ProgramGeneratorImpl.java:224)
> > >         at
> > >
> > org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(Pr
> > ogramGeneratorImpl.java:194)
> > >         at org.apache.cocoon.sitemap.Handler.run(Handler.java:174)
> > >         at java.lang.Thread.run(Thread.java:484)
> > >
> > > 2001-03-06 15:45:20 ERROR   24051   [cocoon  ] (HttpProcessor[8080][4]):
> > > Problem with servlet
> > > org.apache.cocoon.ProcessingException: The sitemap handler's sitemap is
> > > not available.
> > >         at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:107)
> > >         at org.apache.cocoon.Cocoon.process(Cocoon.java:212)
> > >         at
> > > org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:367)
> > >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > >         at
> > >
> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> > FilterChain.java:246)
> > >         at
> > >
> > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> > ain.java:191)
> > >         at
> > >
> > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> > va:254)
> > >         at
> > >
> > org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> > >         at
> > >
> > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> > >         at
> > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:879)
> > >         at
> > >
> > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> > va:201)
> > >         at
> > >
> > org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> > >         at
> > >
> > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> > >         at
> > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:879)
> > >         at
> > > org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2119)
> > >         at
> > >
> > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
> > )
> > >         at
> > >
> > org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> > >         at
> > > org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446)
> > >         at
> > >
> > org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 64)
> > >         at
> > >
> > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> > >         at
> > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:879)
> > >         at
> > >
> > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
> > :162)
> > >         at
> > >
> > org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> > >         at
> > >
> > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> > >         at
> > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:879)
> > >         at
> > >
> > org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
> > 818)
> > >         at
> > >
> > org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:897)
> > >         at java.lang.Thread.run(Thread.java:484)
> > >
> > > that seems simple enough, but my SERVLETAPI_HOME env variable is set
> > > properly:
> > >
> > > [balld@rdu25-4-159 wz-java-library]$ echo $SERVLETAPI_HOME
> > > /home/balld/src/jakarta-servletapi-4
> > >
> > > and it used to work. any quick suggestions before i head over to the
> > > catalina list? fyi, the catalina samples _do_ work, it's just c2 that's
> > > broken.
> > >
> > > - donald
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> > > For additional commands, email: cocoon-dev-help@xml.apache.org
> > >
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> > For additional commands, email: cocoon-dev-help@xml.apache.org
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org

Mime
View raw message