You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Berin Loritsch <bl...@infoplanning.com> on 2000/12/06 17:39:43 UTC

ClassLoader issues...

I tried to have Cocoon fully contained within the webapp
(all classpath defined at that level instead of system).
I ran into two problems: WebSphere has XML4J that takes
precedence over Xerces (conflict of org.xml.sax.**),
and Cocoon can't find resources.

First problem I thought no problem, I'll put Xerces in
the main classpath, and there won't be an issue.  This
was a problem because the second issue surfaced.

The classloader that Cocoon had at the point of preparing
for compilation (Sitemap) did not have the reference to
the XSL sheets (sitemap.xsl, et. al.).

At this point, I tried to add just enough packages back
in the main classpath to get the system to work, but
to no avail: we need everything there.

I tried just Cocoon.jar but it couldn't find avalonapi.jar.
I added that in, but it couldn't find the XSLT engine.

My next attempt will be to separate out the XSL pages
into their own Jar file, and see if that works.  It may
be something flaky like the ClassLoader associated with
WebSphere does not recognize a package if there are no
classes in it.  Mayby a Dummy class in each of the
packages with XSL sheets will force it to load.

Any further insight from those who know.

---------------------------------------
If you lust for Ham and Eggs, you have
committed breakfast in your heart
already.   -- C. S. Lewis


Re: ClassLoader issues...

Posted by Berin Loritsch <bl...@infoplanning.com>.
----- Original Message ----- 
From: "Giacomo Pati" <gi...@apache.org>
To: <co...@xml.apache.org>
Sent: Wednesday, December 06, 2000 5:04 PM
Subject: Re: ClassLoader issues...


> Berin Loritsch wrote:
> > 
> > ----- Original Message -----
> > From: "Berin Loritsch" <bl...@infoplanning.com>
> > To: <co...@xml.apache.org>
> > Sent: Wednesday, December 06, 2000 11:39 AM
> > Subject: ClassLoader issues...
> > 
> > > My next attempt will be to separate out the XSL pages
> > > into their own Jar file, and see if that works.  It may
> > > be something flaky like the ClassLoader associated with
> > > WebSphere does not recognize a package if there are no
> > > classes in it.  Mayby a Dummy class in each of the
> > > packages with XSL sheets will force it to load.
> > >
> > > Any further insight from those who know?
> > 
> > The Dummy class trick didn't work.  It found the class,
> > but not the resources.  This is frustrating.  Basically,
> > unless the resources are in a separate archive, and in
> > the SystemClassLoader, then Cocoon can't find the resources
> > in IBM WebSphere.
> > 
> > What do you guys think?  Should we separate out the
> > XSP/Sitemap resources into another Jar file, or live with
> > EVERYTHING in the System classpath?
> 
> Well, I don't know. I can't see which is producing the problem. Is it
> Tomcat or WebSphere which has implemented something incorrect? If it is
> WebSphere and we cannt use the war file (because of xml4j) we should
> suggest putting all into the System classpath.

WebSphere already has identified bugs with it's classloader
(i.e. the URL handler for its own "classloader:" protocol).

> BTW can't we use XML4j instead of Xerces for C2? Is C2 depandant on
> Xerces?

XML4J does not have namespace support (hense the problem).

> > We might be able to parse the ClassPath setting looking for
> > cocoon.jar, and build the URL with the format like this:
> > 
> > jar://path/to/cocoon.jar!/path/to/resource.xsl
> > 
> > It might be the most portable way to do it...

The J2SE has support for a couple of protocols built in.
One of the protocols is the "jar" protocol.  Once you have
the jar, you can get resources out of it.


Re: ClassLoader issues...

Posted by Giacomo Pati <gi...@apache.org>.
Berin Loritsch wrote:
> 
> ----- Original Message -----
> From: "Berin Loritsch" <bl...@infoplanning.com>
> To: <co...@xml.apache.org>
> Sent: Wednesday, December 06, 2000 11:39 AM
> Subject: ClassLoader issues...
> 
> > My next attempt will be to separate out the XSL pages
> > into their own Jar file, and see if that works.  It may
> > be something flaky like the ClassLoader associated with
> > WebSphere does not recognize a package if there are no
> > classes in it.  Mayby a Dummy class in each of the
> > packages with XSL sheets will force it to load.
> >
> > Any further insight from those who know?
> 
> The Dummy class trick didn't work.  It found the class,
> but not the resources.  This is frustrating.  Basically,
> unless the resources are in a separate archive, and in
> the SystemClassLoader, then Cocoon can't find the resources
> in IBM WebSphere.
> 
> What do you guys think?  Should we separate out the
> XSP/Sitemap resources into another Jar file, or live with
> EVERYTHING in the System classpath?

Well, I don't know. I can't see which is producing the problem. Is it
Tomcat or WebSphere which has implemented something incorrect? If it is
WebSphere and we cannt use the war file (because of xml4j) we should
suggest putting all into the System classpath. 

BTW can't we use XML4j instead of Xerces for C2? Is C2 depandant on
Xerces?

Giacomo

> 
> We might be able to parse the ClassPath setting looking for
> cocoon.jar, and build the URL with the format like this:
> 
> jar://path/to/cocoon.jar!/path/to/resource.xsl
> 
> It might be the most portable way to do it...

??

Re: ClassLoader issues...

Posted by Berin Loritsch <bl...@infoplanning.com>.
----- Original Message ----- 
From: "Berin Loritsch" <bl...@infoplanning.com>
To: <co...@xml.apache.org>
Sent: Wednesday, December 06, 2000 11:39 AM
Subject: ClassLoader issues...


> My next attempt will be to separate out the XSL pages
> into their own Jar file, and see if that works.  It may
> be something flaky like the ClassLoader associated with
> WebSphere does not recognize a package if there are no
> classes in it.  Mayby a Dummy class in each of the
> packages with XSL sheets will force it to load.
> 
> Any further insight from those who know?


The Dummy class trick didn't work.  It found the class,
but not the resources.  This is frustrating.  Basically,
unless the resources are in a separate archive, and in
the SystemClassLoader, then Cocoon can't find the resources
in IBM WebSphere.

What do you guys think?  Should we separate out the
XSP/Sitemap resources into another Jar file, or live with
EVERYTHING in the System classpath?

We might be able to parse the ClassPath setting looking for
cocoon.jar, and build the URL with the format like this:

jar://path/to/cocoon.jar!/path/to/resource.xsl

It might be the most portable way to do it...