You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Sebastien Sahuc <ss...@imediation.com> on 2000/09/25 23:44:35 UTC

Re: re directorygenerator on latest cvs build (25-09-00)@4

YAHOOOOO !!!! I'm happy not to be the only one. I'm was precisely writing 
a post explaining why IMHO something smells bad in these classlaoder 
issues and design.

See below for an explanation of your linkage error.


>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 9/25/00, 11:30:56 PM, Giacomo Pati <Gi...@pwr.ch> wrote regarding 
re directorygenerator on latest cvs build (25-09-00)@4:


> Giacomo Pati wrote:
> >
> > Stefano Mazzocchi wrote:
> > >
> > > Giacomo Pati wrote:
> > > >
> > > > --- WAS Online <wa...@ndrmobil.de> wrote:
> > > > > Hi there,
> > > > >
> > > > > finally i got C2 to work with catalina... (phew) which cost me a
> lot
> > > > > of
> > > > > nerves, since the repositories do not seem to be in a
> 'synchronized'
> > > > > state at all, as i had to edit a lot of files to get all that
> > > > > components
> > > > > to work whith each other. Anyway, may problem is of another
> kind:
> > > >
> > > > Can you explain your problems? I usually compile Tomcat-4.0 with
> 'build
> > > > dist', put all jars from [cocoon2]/lib (except ant and stylebook I
> > > > think) into dist/tomcat-4.0/lib and put the cocoon.war file into
> > > > dist/tomcat-4.0/webapps (I remember having expanded the cocoon.war
> > > > manualy into a cocoon directory)
> > >
> > > Please, stop doing this.
> > >
> > > The Catalina ./lib directory _MUST_ remain clean... you should not
> put
> > > the C2 libraries there...otherwise how can we have feedback on
> Servlet
> > > 2.2 application behavior?
> > >
> > > The "right way" of installing C2 on catalina should be
> > >
> > > ./build.sh -Dinstall.war=../build/tomcat-4.0/webapps
> > > -Dinclude.webapp.libs=yes install
> >
> > Yes, I know how it should be, but at the moment it seems not to run
> that
> > way (almost not for me) because of a ClassLoader problem in catalina.
> > Have you got it running?

> The above happens when I run catalina out of the ../dist/tomcat-4.0
> directory.

> If I use the ../build/tomcat-4.0 directory there is still something
> wrong with the sitemap engine.
> The logs/catalina.out tells me something about

> java.lang.LinkageError: Class org/xml/sax/Attributes violates loader
> constraints
>         at
> _cvs._build._tomcat_4_0._webapps._cocoon._sitemap_xmap.setConfiguration(
> _sitemap_xmap.java:519)
>         at
> org.apache.cocoon.sitemap.SitemapHandler.run(SitemapHandler.java,
> Compiled Code)
>         at java.lang.Thread.run(Thread.java, Compiled Code)

> and the error notifier tells me something totally different ?!

Basicaly you're getting this error because you have Xerces in too many 
places :
One in your System classpath and another time in your web-inf/lib of your 
web application (currently cocoon2).

So by removing the Xerces jar from your web-inf/lib, you should be able 
to make cocoon2 works again ... (though your XSP pages won't compile 
because of missing DOM and SAX packages...)

See my next post for the XSP pages.

Sebastien

> Giacomo

> --
> PWR GmbH, Organisation & Entwicklung      Tel:   +41 (0)1  856 2202
> Giacomo Pati, CTO/CEO                     Fax:   +41 (0)1  856 2201
> Hintereichenstrasse 7                     Mobil: +41 (0)78 759 7703
> CH-8166 Niederweningen                    Mailto:Giacomo.Pati@pwr.ch
>                                           Web:   http://www.pwr.ch

Re: re re directorygenerator on latest cvs build (25-09-00)@4@1

Posted by Sebastien Sahuc <ss...@imediation.com>.

>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 9/26/00, 7:09:27 AM, Giacomo Pati <Gi...@pwr.ch> wrote regarding 
Re: re re directorygenerator on latest cvs build (25-09-00)@4@1:


> Sebastien Sahuc wrote:
> >
> > Stefano Mazzocchi wrote :
> >
> > > Sebastien Sahuc wrote:
> > > >
> > > > YAHOOOOO !!!! I'm happy not to be the only one. I'm was precisely
> > > writing
> > > > a post explaining why IMHO something smells bad in these classlaoder
> > > > issues and design.
> >
> > > There is no bad design in Catalina's classloader... the problem is
> > > simple: a servlet engine is a damn complex beast and Cocoon2 pushes this
> > > to the ultimate limits.
> >
> > No, I'm not saying that Catalina is bad designed, not at all !
> >
> > The problem is that if only I had to deal with Servlet Engine + cocoon, I
> > would be fine.
> > What I'm doing is even more complex :
> > Integrate an EJB Container with Catalina so that they work in the same
> > JVM,
> > plugs Cocoon into Catalina with XSP page acting as EJB client.
> > Make these Beans using Castor as a ORMapper tool to a backend storage,
> > and to finsh glue the JMX stuff and write all these components as MBEans
> > ...
> >
> > That's why I'm experiencing these damn classloader issues and
> > complication. I finally succeeded by cleaning to maximum and by setting
> > to system classpath what is common to all :
> > * javax.* intrerfaces ( EJB, JTA, JNDI, Servlet, JMX, JDBC ext, etc...) ;
> > * Xerces (used EVERYWHERE !)
> > * tools.jar
> >
> > > > See below for an explanation of your linkage error.
> > > >
> > > > >>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<
> > > >
> > > > On 9/25/00, 11:30:56 PM, Giacomo Pati <Gi...@pwr.ch> wrote
> > > regarding
> > > > re directorygenerator on latest cvs build (25-09-00)@4:
> > > >
> > > > > Giacomo Pati wrote:
> > > > > >
> > > > > > Stefano Mazzocchi wrote:
> > > > > > >
> > > > > > > Giacomo Pati wrote:
> > > > > > > >
> > > > > > > > --- WAS Online <wa...@ndrmobil.de> wrote:
> > > > > > > > > Hi there,
> > > > > > > > >
> > > > > > > > > finally i got C2 to work with catalina... (phew) which cost
> > > me a
> > > > > lot
> > > > > > > > > of
> > > > > > > > > nerves, since the repositories do not seem to be in a
> > > > > 'synchronized'
> > > > > > > > > state at all, as i had to edit a lot of files to get all
> > > that
> > > > > > > > > components
> > > > > > > > > to work whith each other. Anyway, may problem is of another
> > > > > kind:
> > > > > > > >
> > > > > > > > Can you explain your problems? I usually compile Tomcat-4.0
> > > with
> > > > > 'build
> > > > > > > > dist', put all jars from [cocoon2]/lib (except ant and
> > > stylebook I
> > > > > > > > think) into dist/tomcat-4.0/lib and put the cocoon.war file
> > > into
> > > > > > > > dist/tomcat-4.0/webapps (I remember having expanded the
> > > cocoon.war
> > > > > > > > manualy into a cocoon directory)
> > > > > > >
> > > > > > > Please, stop doing this.
> > > > > > >
> > > > > > > The Catalina ./lib directory _MUST_ remain clean... you should
> > > not
> > > > > put
> > > > > > > the C2 libraries there...otherwise how can we have feedback on
> > > > > Servlet
> > > > > > > 2.2 application behavior?
> > > > > > >
> > > > > > > The "right way" of installing C2 on catalina should be
> > > > > > >
> > > > > > > ./build.sh -Dinstall.war=../build/tomcat-4.0/webapps
> > > > > > > -Dinclude.webapp.libs=yes install
> > > > > >
> > > > > > Yes, I know how it should be, but at the moment it seems not to
> > > run
> > > > > that
> > > > > > way (almost not for me) because of a ClassLoader problem in
> > > catalina.
> > > > > > Have you got it running?
> > > >
> > > > > The above happens when I run catalina out of the ../dist/tomcat-4.0
> > > > > directory.
> > > >
> > > > > If I use the ../build/tomcat-4.0 directory there is still something
> > > > > wrong with the sitemap engine.
> > > > > The logs/catalina.out tells me something about
> > > >
> > > > > java.lang.LinkageError: Class org/xml/sax/Attributes violates loader
> > > > > constraints
> > > > >         at
> > > > >
> > > _cvs._build._tomcat_4_0._webapps._cocoon._sitemap_xmap.setConfiguration(
> > > > > _sitemap_xmap.java:519)
> > > > >         at
> > > > > org.apache.cocoon.sitemap.SitemapHandler.run(SitemapHandler.java,
> > > > > Compiled Code)
> > > > >         at java.lang.Thread.run(Thread.java, Compiled Code)
> > > >
> > > > > and the error notifier tells me something totally different ?!
> > > >
> > > > Basicaly you're getting this error because you have Xerces in too many
> > > > places :
> > > > One in your System classpath and another time in your web-inf/lib of
> > > your
> > > > web application (currently cocoon2).
> >
> > > This shouldn't make any difference since the classpath passed to javac
> > > has the local classpath (web-inf/lib) *before* the system classpath.
> >
> > Well I believe it because some change have been commited since I last
> > checkout, that might be the reeason why we're not experiencing the exact
> > same behavior... my bad...
> >
> > > > So by removing the Xerces jar from your web-inf/lib, you should be
> > > able
> > > > to make cocoon2 works again ... (though your XSP pages won't compile
> > > > because of missing DOM and SAX packages...)
> >
> > > How come everything works smoothly on my system? Did you clean your
> > > lib/ext directory?
> >
> > Are you speaking of {$JAVA_HOME}/lib/ext ? If so, I do NEVER touch it
> > because of its 'hazardous' effect, so it might be something else.
> >
> > OK, so could you please experiment the following :
> > remove jaxp.jar and server.jar from {$CATALINA_HOME}/lib
> > instead put your Xerces.jar (into {$CATALINA_HOME}/lib )
> >
> > So you should have the same Xerces.jar into 2 location (the other one is
> > in the webapp/web-inf/lib)
> >
> > Then starts your catalina server as usual from the 'bin' script dir, and
> > check by yourself if you don't get the Linkage error... If not please
> > tell us so that I double check what is missing compared to the current
> > cvs.
> >
> > The linkage error disapear when you rmove either the xerces.jar from lib
> > or either from web-inf/lib
> >
> > Giacomo, was this what you experienced ?

> After removing xerces.jar from tomcat-4.0/lib it works. But this cannot
> be a solution. But is this better that putting all jar into tomcat/lib,
> Stefano?

That's why I ended up with javax.*, Xerces, JMX and Javac.jar into system 
classpath because that clean up lot of stuff and speed up the whole 
process (not only the starting process, but also the mem footprint)

> Sebastien, are you using catalina from tomcat/proposal/catalina or the
> real tomcat-4.0?

The real tomcat-4.0 milestone 1 

All the best,

Sebastien




> Giacomo

> --
> PWR GmbH, Organisation & Entwicklung      Tel:   +41 (0)1  856 2202
> Giacomo Pati, CTO/CEO                     Fax:   +41 (0)1  856 2201
> Hintereichenstrasse 7                     Mobil: +41 (0)78 759 7703
> CH-8166 Niederweningen                    Mailto:Giacomo.Pati@pwr.ch
>                                           Web:   http://www.pwr.ch

Re: re re directorygenerator on latest cvs build (25-09-00)@4@1

Posted by Sebastien Sahuc <ss...@imediation.com>.
Stefano Mazzocchi wrote :


> Sebastien Sahuc wrote:
> >
> > YAHOOOOO !!!! I'm happy not to be the only one. I'm was precisely
> writing
> > a post explaining why IMHO something smells bad in these classlaoder
> > issues and design.

> There is no bad design in Catalina's classloader... the problem is
> simple: a servlet engine is a damn complex beast and Cocoon2 pushes this
> to the ultimate limits.

No, I'm not saying that Catalina is bad designed, not at all ! 

The problem is that if only I had to deal with Servlet Engine + cocoon, I 
would be fine. 
What I'm doing is even more complex : 
Integrate an EJB Container with Catalina so that they work in the same 
JVM, 
plugs Cocoon into Catalina with XSP page acting as EJB client. 
Make these Beans using Castor as a ORMapper tool to a backend storage, 
and to finsh glue the JMX stuff and write all these components as MBEans 
... 

That's why I'm experiencing these damn classloader issues and 
complication. I finally succeeded by cleaning to maximum and by setting 
to system classpath what is common to all : 
* javax.* intrerfaces ( EJB, JTA, JNDI, Servlet, JMX, JDBC ext, etc...) ;
* Xerces (used EVERYWHERE !)
* tools.jar

> > See below for an explanation of your linkage error.
> >
> > >>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<
> >
> > On 9/25/00, 11:30:56 PM, Giacomo Pati <Gi...@pwr.ch> wrote
> regarding
> > re directorygenerator on latest cvs build (25-09-00)@4:
> >
> > > Giacomo Pati wrote:
> > > >
> > > > Stefano Mazzocchi wrote:
> > > > >
> > > > > Giacomo Pati wrote:
> > > > > >
> > > > > > --- WAS Online <wa...@ndrmobil.de> wrote:
> > > > > > > Hi there,
> > > > > > >
> > > > > > > finally i got C2 to work with catalina... (phew) which cost
> me a
> > > lot
> > > > > > > of
> > > > > > > nerves, since the repositories do not seem to be in a
> > > 'synchronized'
> > > > > > > state at all, as i had to edit a lot of files to get all
> that
> > > > > > > components
> > > > > > > to work whith each other. Anyway, may problem is of another
> > > kind:
> > > > > >
> > > > > > Can you explain your problems? I usually compile Tomcat-4.0
> with
> > > 'build
> > > > > > dist', put all jars from [cocoon2]/lib (except ant and
> stylebook I
> > > > > > think) into dist/tomcat-4.0/lib and put the cocoon.war file
> into
> > > > > > dist/tomcat-4.0/webapps (I remember having expanded the
> cocoon.war
> > > > > > manualy into a cocoon directory)
> > > > >
> > > > > Please, stop doing this.
> > > > >
> > > > > The Catalina ./lib directory _MUST_ remain clean... you should
> not
> > > put
> > > > > the C2 libraries there...otherwise how can we have feedback on
> > > Servlet
> > > > > 2.2 application behavior?
> > > > >
> > > > > The "right way" of installing C2 on catalina should be
> > > > >
> > > > > ./build.sh -Dinstall.war=../build/tomcat-4.0/webapps
> > > > > -Dinclude.webapp.libs=yes install
> > > >
> > > > Yes, I know how it should be, but at the moment it seems not to
> run
> > > that
> > > > way (almost not for me) because of a ClassLoader problem in
> catalina.
> > > > Have you got it running?
> >
> > > The above happens when I run catalina out of the ../dist/tomcat-4.0
> > > directory.
> >
> > > If I use the ../build/tomcat-4.0 directory there is still something
> > > wrong with the sitemap engine.
> > > The logs/catalina.out tells me something about
> >
> > > java.lang.LinkageError: Class org/xml/sax/Attributes violates loader
> > > constraints
> > >         at
> > >
> _cvs._build._tomcat_4_0._webapps._cocoon._sitemap_xmap.setConfiguration(
> > > _sitemap_xmap.java:519)
> > >         at
> > > org.apache.cocoon.sitemap.SitemapHandler.run(SitemapHandler.java,
> > > Compiled Code)
> > >         at java.lang.Thread.run(Thread.java, Compiled Code)
> >
> > > and the error notifier tells me something totally different ?!
> >
> > Basicaly you're getting this error because you have Xerces in too many
> > places :
> > One in your System classpath and another time in your web-inf/lib of
> your
> > web application (currently cocoon2).

> This shouldn't make any difference since the classpath passed to javac
> has the local classpath (web-inf/lib) *before* the system classpath.

Well I believe it because some change have been commited since I last 
checkout, that might be the reeason why we're not experiencing the exact 
same behavior... my bad...


> > So by removing the Xerces jar from your web-inf/lib, you should be
> able
> > to make cocoon2 works again ... (though your XSP pages won't compile
> > because of missing DOM and SAX packages...)

> How come everything works smoothly on my system? Did you clean your
> lib/ext directory?

Are you speaking of {$JAVA_HOME}/lib/ext ? If so, I do NEVER touch it 
because of its 'hazardous' effect, so it might be something else. 

OK, so could you please experiment the following :
remove jaxp.jar and server.jar from {$CATALINA_HOME}/lib
instead put your Xerces.jar (into {$CATALINA_HOME}/lib )

So you should have the same Xerces.jar into 2 location (the other one is 
in the webapp/web-inf/lib)

Then starts your catalina server as usual from the 'bin' script dir, and 
check by yourself if you don't get the Linkage error... If not please 
tell us so that I double check what is missing compared to the current 
cvs.

The linkage error disapear when you rmove either the xerces.jar from lib 
or either from web-inf/lib

Giacomo, was this what you experienced ?


Thanks,

Sebastien







> --
> Stefano Mazzocchi      One must still have chaos in oneself to be
>                           able to give birth to a dancing star.
> <st...@apache.org>                             Friedrich Nietzsche
> --------------------------------------------------------------------
>  Missed us in Orlando? Make it up with ApacheCON Europe in London!
> ------------------------- http://ApacheCon.Com ---------------------

Re: re directorygenerator on latest cvs build (25-09-00)@4

Posted by Stefano Mazzocchi <st...@apache.org>.
Sebastien Sahuc wrote:
> 
> YAHOOOOO !!!! I'm happy not to be the only one. I'm was precisely writing
> a post explaining why IMHO something smells bad in these classlaoder
> issues and design.

There is no bad design in Catalina's classloader... the problem is
simple: a servlet engine is a damn complex beast and Cocoon2 pushes this
to the ultimate limits.
 
> See below for an explanation of your linkage error.
> 
> >>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<
> 
> On 9/25/00, 11:30:56 PM, Giacomo Pati <Gi...@pwr.ch> wrote regarding
> re directorygenerator on latest cvs build (25-09-00)@4:
> 
> > Giacomo Pati wrote:
> > >
> > > Stefano Mazzocchi wrote:
> > > >
> > > > Giacomo Pati wrote:
> > > > >
> > > > > --- WAS Online <wa...@ndrmobil.de> wrote:
> > > > > > Hi there,
> > > > > >
> > > > > > finally i got C2 to work with catalina... (phew) which cost me a
> > lot
> > > > > > of
> > > > > > nerves, since the repositories do not seem to be in a
> > 'synchronized'
> > > > > > state at all, as i had to edit a lot of files to get all that
> > > > > > components
> > > > > > to work whith each other. Anyway, may problem is of another
> > kind:
> > > > >
> > > > > Can you explain your problems? I usually compile Tomcat-4.0 with
> > 'build
> > > > > dist', put all jars from [cocoon2]/lib (except ant and stylebook I
> > > > > think) into dist/tomcat-4.0/lib and put the cocoon.war file into
> > > > > dist/tomcat-4.0/webapps (I remember having expanded the cocoon.war
> > > > > manualy into a cocoon directory)
> > > >
> > > > Please, stop doing this.
> > > >
> > > > The Catalina ./lib directory _MUST_ remain clean... you should not
> > put
> > > > the C2 libraries there...otherwise how can we have feedback on
> > Servlet
> > > > 2.2 application behavior?
> > > >
> > > > The "right way" of installing C2 on catalina should be
> > > >
> > > > ./build.sh -Dinstall.war=../build/tomcat-4.0/webapps
> > > > -Dinclude.webapp.libs=yes install
> > >
> > > Yes, I know how it should be, but at the moment it seems not to run
> > that
> > > way (almost not for me) because of a ClassLoader problem in catalina.
> > > Have you got it running?
> 
> > The above happens when I run catalina out of the ../dist/tomcat-4.0
> > directory.
> 
> > If I use the ../build/tomcat-4.0 directory there is still something
> > wrong with the sitemap engine.
> > The logs/catalina.out tells me something about
> 
> > java.lang.LinkageError: Class org/xml/sax/Attributes violates loader
> > constraints
> >         at
> > _cvs._build._tomcat_4_0._webapps._cocoon._sitemap_xmap.setConfiguration(
> > _sitemap_xmap.java:519)
> >         at
> > org.apache.cocoon.sitemap.SitemapHandler.run(SitemapHandler.java,
> > Compiled Code)
> >         at java.lang.Thread.run(Thread.java, Compiled Code)
> 
> > and the error notifier tells me something totally different ?!
> 
> Basicaly you're getting this error because you have Xerces in too many
> places :
> One in your System classpath and another time in your web-inf/lib of your
> web application (currently cocoon2).

This shouldn't make any difference since the classpath passed to javac
has the local classpath (web-inf/lib) *before* the system classpath.
 
> So by removing the Xerces jar from your web-inf/lib, you should be able
> to make cocoon2 works again ... (though your XSP pages won't compile
> because of missing DOM and SAX packages...)

How come everything works smoothly on my system? Did you clean your
lib/ext directory?
 
-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------