You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Stefano Mazzocchi <st...@apache.org> on 2001/02/15 16:51:26 UTC
classpath problems with cocoon2
This is probably related with what Berin was talking about, but Cocoon2
doesn't work.
Apart from a URLFactory bug which I just fixed, it seems that no matter
what I do I either end up having a "sealing" exception from Tomcat (if I
place everything into /WEB-INF/lib/) or compilation issues with the
sitemap (if I place everything into CATALINA_HOME/lib/)
I noted one thing: Catalina doesn't add the libraries found in
CATALINA_HOST/lib/ in the classpath environment passed to the servlet
contexts.
How does Jasper work, then?
Berin, what servlet engine are you using?
Is anybody working with the latest snapshots from tomcat 4.0 and cocoon2
or I am the only one?
I'm pretty frustrated by these stupid classpath problems.
--
Stefano Mazzocchi One must still have chaos in oneself to be
able to give birth to a dancing star.
<st...@apache.org> Friedrich Nietzsche
--------------------------------------------------------------------
NPE in CocoonServlet with WebLogic6, was: classpath problems with cocoon2
Posted by Vadim Gritsenko <vg...@hns.com>.
> -----Original Message-----
> From: Berin Loritsch [mailto:bloritsch@apache.org]
> Sent: Friday, February 16, 2001 8:41
> To: cocoon-dev@xml.apache.org
> Subject: Re: classpath problems with cocoon2
>
>
<snip/>
> >
> > By 'unsealing' jaxp.jar and crimson.jar and adding 'servlet.jar' to the
> > context classpath attribute, Cocoon2 works perfectly out of a single jar
> > on Catalina.
> >
> > I believe this is a pretty damn good result given the problems we face
> > and there are no side effects in these changes.
>
> Yeah, but how many other implementations do we have to worry about.
> BEA is another one--although I will attempt to unseal their XML parser
> to get the same results.
Neither 5.1, nor 6.0 have sealed JARs. 5.1 even doesn't have META-INF
directory
in jar...
But what I got when tried to drop cocoon.war into Weblogic 6 is NPE:
java.lang.NullPointerException
at java.io.File.<init>(File.java:181)
at
org.apache.cocoon.servlet.CocoonServlet.getClassPath(CocoonServlet.java:140)
at org.apache.cocoon.servlet.CocoonServlet.init(CocoonServlet.java:105)
at
weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java
:687)
at
weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.ja
va:625)
at
weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.jav
a:573)
at
weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:29
5)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:204)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:1127)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:1529)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
PS Fresh cocoon from CVS
Regards,
Vadim
Re: classpath problems with cocoon2
Posted by Berin Loritsch <bl...@apache.org>.
Stefano Mazzocchi wrote:
>
> Berin Loritsch wrote:
> >
> > Stefano Mazzocchi wrote:
> > >
> > > This is probably related with what Berin was talking about, but Cocoon2
> > > doesn't work.
> > >
> > > Apart from a URLFactory bug which I just fixed, it seems that no matter
> > > what I do I either end up having a "sealing" exception from Tomcat (if I
> > > place everything into /WEB-INF/lib/) or compilation issues with the
> > > sitemap (if I place everything into CATALINA_HOME/lib/)
> > >
> > > I noted one thing: Catalina doesn't add the libraries found in
> > > CATALINA_HOST/lib/ in the classpath environment passed to the servlet
> > > contexts.
> > >
> > > How does Jasper work, then?
> > >
> > > Berin, what servlet engine are you using?
> >
> > I am using Tomcat 3.2.1 (and <sheepishly>IBM WebSphere</sheepishly>).
> > IBM WebSphere requires all the jars in CLASSPATH (yuck). My next solution
> > is to have a different ServletEngine depending on Servlet 2.2 or Servlet
> > 2.3--Servlet 2.3 engine won't do classloader juggling while Servlet 2.2
> > will. That will satisfy both our concerns.
> >
> > I have not yet seen any clean way around the JAXP 1.1 vs. 1.0 issues.
> > That is the one thing that is going to keep us from doing one complete
> > jar.
> >
> > Temporary solution is to place Xerces in CATALINA_HOST/lib/ as well--
> > breaking Jasper.
>
> By 'unsealing' jaxp.jar and crimson.jar and adding 'servlet.jar' to the
> context classpath attribute, Cocoon2 works perfectly out of a single jar
> on Catalina.
>
> I believe this is a pretty damn good result given the problems we face
> and there are no side effects in these changes.
Yeah, but how many other implementations do we have to worry about.
BEA is another one--although I will attempt to unseal their XML parser
to get the same results.
Jar Sealing was introduced to keep malicious code from attaching itself
in your packages during run-time. Now, on an XML parser there is little
damage that malicious code can perform (besides to itself), but in many
commercial AppServers like BEA and IBM they place many different
components in the same jar.
I introduced two Servlets in the Cocoon archives. The trusting one
CocoonServlet that assumes you have a sane invironment, and an
untrusting one called ParanoidCocoonServlet--required for IBM WebSphere
with broken ClassLoaders (you can't get resources from its classloaders).
Unsealing jars in production environments is a risky thing and voids
warranty on commercial systems. We still need to look for a more
elegant solution.
I thought that the Servlet 2.3 spec required that the Webapp was
COMPLETELY separated from the Servlet Container--Mainly for the
JAXP and XML parsing issues. For that reason I would site Catalina
as breaking the spec...
Re: classpath problems with cocoon2
Posted by Stefano Mazzocchi <st...@apache.org>.
Berin Loritsch wrote:
>
> Stefano Mazzocchi wrote:
> >
> > This is probably related with what Berin was talking about, but Cocoon2
> > doesn't work.
> >
> > Apart from a URLFactory bug which I just fixed, it seems that no matter
> > what I do I either end up having a "sealing" exception from Tomcat (if I
> > place everything into /WEB-INF/lib/) or compilation issues with the
> > sitemap (if I place everything into CATALINA_HOME/lib/)
> >
> > I noted one thing: Catalina doesn't add the libraries found in
> > CATALINA_HOST/lib/ in the classpath environment passed to the servlet
> > contexts.
> >
> > How does Jasper work, then?
> >
> > Berin, what servlet engine are you using?
>
> I am using Tomcat 3.2.1 (and <sheepishly>IBM WebSphere</sheepishly>).
> IBM WebSphere requires all the jars in CLASSPATH (yuck). My next solution
> is to have a different ServletEngine depending on Servlet 2.2 or Servlet
> 2.3--Servlet 2.3 engine won't do classloader juggling while Servlet 2.2
> will. That will satisfy both our concerns.
>
> I have not yet seen any clean way around the JAXP 1.1 vs. 1.0 issues.
> That is the one thing that is going to keep us from doing one complete
> jar.
>
> Temporary solution is to place Xerces in CATALINA_HOST/lib/ as well--
> breaking Jasper.
By 'unsealing' jaxp.jar and crimson.jar and adding 'servlet.jar' to the
context classpath attribute, Cocoon2 works perfectly out of a single jar
on Catalina.
I believe this is a pretty damn good result given the problems we face
and there are no side effects in these changes.
--
Stefano Mazzocchi One must still have chaos in oneself to be
able to give birth to a dancing star.
<st...@apache.org> Friedrich Nietzsche
--------------------------------------------------------------------
Re: classpath problems with cocoon2
Posted by Berin Loritsch <bl...@apache.org>.
Stefano Mazzocchi wrote:
>
> This is probably related with what Berin was talking about, but Cocoon2
> doesn't work.
>
> Apart from a URLFactory bug which I just fixed, it seems that no matter
> what I do I either end up having a "sealing" exception from Tomcat (if I
> place everything into /WEB-INF/lib/) or compilation issues with the
> sitemap (if I place everything into CATALINA_HOME/lib/)
>
> I noted one thing: Catalina doesn't add the libraries found in
> CATALINA_HOST/lib/ in the classpath environment passed to the servlet
> contexts.
>
> How does Jasper work, then?
>
> Berin, what servlet engine are you using?
I am using Tomcat 3.2.1 (and <sheepishly>IBM WebSphere</sheepishly>).
IBM WebSphere requires all the jars in CLASSPATH (yuck). My next solution
is to have a different ServletEngine depending on Servlet 2.2 or Servlet
2.3--Servlet 2.3 engine won't do classloader juggling while Servlet 2.2
will. That will satisfy both our concerns.
I have not yet seen any clean way around the JAXP 1.1 vs. 1.0 issues.
That is the one thing that is going to keep us from doing one complete
jar.
Temporary solution is to place Xerces in CATALINA_HOST/lib/ as well--
breaking Jasper.
>
> Is anybody working with the latest snapshots from tomcat 4.0 and cocoon2
> or I am the only one?
>
> I'm pretty frustrated by these stupid classpath problems.
>
> --
> Stefano Mazzocchi One must still have chaos in oneself to be
> able to give birth to a dancing star.
> <st...@apache.org> Friedrich Nietzsche
> --------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
Re: classpath problems with cocoon2
Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Stefano Mazzocchi wrote:
> This is probably related with what Berin was talking about, but Cocoon2
> doesn't work.
>
> Apart from a URLFactory bug which I just fixed, it seems that no matter
> what I do I either end up having a "sealing" exception from Tomcat (if I
> place everything into /WEB-INF/lib/) or compilation issues with the
> sitemap (if I place everything into CATALINA_HOME/lib/)
>
Yep .. see previous mail about jaxp.jar and crimson.jar being sealed.
Possible workaround -- replace these two JAR files with xerces.jar from
Xerces 2.0 alpha. I would appreciate it if people would try this and report
back success or failure.
>
> I noted one thing: Catalina doesn't add the libraries found in
> CATALINA_HOST/lib/ in the classpath environment passed to the servlet
> contexts.
>
> How does Jasper work, then?
>
They are added to the "shared" class loader, which is the parent of all web
app class loaders. There is documentation on how class loaders work in the
developer's documentation on Catalina, or at the following file in the
source repository:
http://jakarta.apache.org/cvsweb/index.cgi/~checkout~/jakarta-tomcat-4.0/catalina/docs/dev/classloaders.html?rev=1.2&content-type=text/html
>
> Berin, what servlet engine are you using?
>
> Is anybody working with the latest snapshots from tomcat 4.0 and cocoon2
> or I am the only one?
>
> I'm pretty frustrated by these stupid classpath problems.
>
> --
> Stefano Mazzocchi One must still have chaos in oneself to be
> able to give birth to a dancing star.
> <st...@apache.org> Friedrich Nietzsche
> --------------------------------------------------------------------
Craig