You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Stefano Mazzocchi <st...@apache.org> on 2000/09/27 13:09:23 UTC

[bug] linking error

"Craig R. McClanahan" wrote:

> > However, I agree that shared libraries are badly defined in the W3C/XML world.
> > a) The classes from W3C were never properly packaged and maintained into JAR
> > files. Every user tend to put them into their own JARs
> > b) The same classes are not compatible between versions. I can not simply replace
> > them with the latest version (by compiling and putting them in a JAR in the
> > lib/ext/ directory) which would temporarily solve my problems.
> >
> > But I guess you are on top of this...
> 
> I wouldn't say necessarily "on top of" -- more "suffering the consequences of" along
> with everyone else :-).

We appear to suffer more consequences of this than planned.

Here is another pretty serious bug report:

1) downloaded Tomcat 4.0M1
2) latest Cocoon2 from CVS

when executed (Sun JDK 1.3 under Win2k) I get

java.lang.LinkageError: Class org/xml/sax/Attributes violates loader
constraints
        at
_C_._Code._apache_org._jakarta_tomcat_4_0_m1._webapps._cocoon._sitemap_xmap.setConfiguration(_sitemap_xmap.java:480)
        at
org.apache.cocoon.sitemap.SitemapHandler.run(SitemapHandler.java:149)
        at java.lang.Thread.run(Thread.java:479)

but if I remove xerces.jar from /lib everything works just fine.

NOTE: cocoon/WEB-INF/lib *does* include Xerces_1.2.jar along with the
right SAX classes.

How about that?

-- 
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: [bug] linking error

Posted by Conny Krappatsch <co...@smb-tec.com>.
Stefano Mazzocchi wrote:
> Here is another pretty serious bug report:
> 
> 1) downloaded Tomcat 4.0M1
> 2) latest Cocoon2 from CVS
> 
> when executed (Sun JDK 1.3 under Win2k) I get
> 
> java.lang.LinkageError: Class org/xml/sax/Attributes violates loader
> constraints
>         at
> _C_._Code._apache_org._jakarta_tomcat_4_0_m1._webapps._cocoon._sitemap_xmap.setConfiguration(_sitemap_xmap.java:480)
>         at
> org.apache.cocoon.sitemap.SitemapHandler.run(SitemapHandler.java:149)
>         at java.lang.Thread.run(Thread.java:479)
> 
> but if I remove xerces.jar from /lib everything works just fine.

Looks like the problem I reported in my previous mail. Removing
xerces.jar worked, too (thanks for this).

My configuration is Tomcat 4.0M1, latest Cocoon2 from CVS, JDK 1.2.2 under
Linux.

-- 
_____________________________________________________________________
Conny Krappatsch                             mailto:conny@smb-tec.com
SMB GmbH                                       http://www.smb-tec.com




Re: [bug] linking error

Posted by Giacomo Pati <Gi...@pwr.ch>.
Stefano Mazzocchi wrote:
> 
> Giacomo Pati wrote:
> >
> > Stefano Mazzocchi wrote:
> > >
> > > "Craig R. McClanahan" wrote:
> > > >
> > > > Stefano Mazzocchi wrote:
> > > >
> > > > > "Craig R. McClanahan" wrote:
> > > > >
> > > > > > > However, I agree that shared libraries are badly defined in the W3C/XML world.
> > > > > > > a) The classes from W3C were never properly packaged and maintained into JAR
> > > > > > > files. Every user tend to put them into their own JARs
> > > > > > > b) The same classes are not compatible between versions. I can not simply replace
> > > > > > > them with the latest version (by compiling and putting them in a JAR in the
> > > > > > > lib/ext/ directory) which would temporarily solve my problems.
> > > > > > >
> > > > > > > But I guess you are on top of this...
> > > > > >
> > > > > > I wouldn't say necessarily "on top of" -- more "suffering the consequences of" along
> > > > > > with everyone else :-).
> > > > >
> > > > > We appear to suffer more consequences of this than planned.
> > > > >
> > > > > Here is another pretty serious bug report:
> > > > >
> > > > > 1) downloaded Tomcat 4.0M1
> > > > > 2) latest Cocoon2 from CVS
> > > > >
> > > > > when executed (Sun JDK 1.3 under Win2k) I get
> > > > >
> > > > > java.lang.LinkageError: Class org/xml/sax/Attributes violates loader
> > > > > constraints
> > > > >         at
> > > > > _C_._Code._apache_org._jakarta_tomcat_4_0_m1._webapps._cocoon._sitemap_xmap.setConfiguration(_sitemap_xmap.java:480)
> > > > >         at
> > > > > org.apache.cocoon.sitemap.SitemapHandler.run(SitemapHandler.java:149)
> > > > >         at java.lang.Thread.run(Thread.java:479)
> > > > >
> > > > > but if I remove xerces.jar from /lib everything works just fine.
> > > > >
> > > > > NOTE: cocoon/WEB-INF/lib *does* include Xerces_1.2.jar along with the
> > > > > right SAX classes.
> > > > >
> > > > > How about that?
> > > > >
> > > >
> > > > I was able to reproduce this, but it fails for me under all three circumstances (xerces.jar in both places, xerces.jar
> > > > in $CATALINA_HOME/lib only, and xerces.jar in the Cocoon WEB-INF/lib only).  In the latter case, it complained about a
> > > > different class (org.w3c.dom.Document) instead.
> > > >
> > > > A few comments and questions.
> > > >
> > > > * According to the Javadocs, a LinkageError means that
> > > >   a class was changed this class depended on, without
> > > >   recompiling this class.  Is there any chance at all that the
> > > >   xerces.jar (from the 1.2 binary download) was not built from
> > > >   scratch (build clean then build dist or whatever)?
> > > >
> > > > * I turned on debugging output in the Catalina class loader.
> > > >   It appears that the actual generated sitemap class is being
> > > >   started on another thread, using a different classloader.  If
> > > >   so, what class is being used, and how is it being configured?
> > > >   I don't know enough Cocoon internals to track this down.
> > >
> > > Oh, shit you're right... didn't think of this...
> > >
> > > Giacomo, did you use a different classloader for the compiling thread?
> >
> > No, I use the XSP engine to compile and instantiate the sitemap. I
> > thought all the classloading stuff should happen in the ClassUtils class
> > now. But after alook into JavaLanguage I've realized that XSP loads
> > class with class.newInstance() and also something about its own
> > classloader. Could this be a problem?
> 
> I thought I unified all classloading thru ClassUtils... is there some
> code that is not using it that way?

Yes. The JavaLanguage class don't loads it with ClassUtils.

> > >
> > > > * Likewise, I don't see anywhere in the code that is writing the
> > > >   LinkageError exception message to System.out in the first
> > > >   place.  Any ideas where this is coming from?  (The stack trace
> > > >   sent back to the browser is a NullPointerException).
> > >
> > > It's out from the above sitemap compiling thread and the NPE is due to a
> > > bug since the two thread are not well communicating... we need to fix
> > > that soon.
> >
> > Tell me hat the general problem is and I'll fix it (if I'm able to).
> 
> Ok, the problem is that if the sitemap cannot be compiled, the exception
> triggered to the browser client is a NPE while the real sitemap
> exception goes to System.out.
> 
> I think this is wrong since the compiling thread should (somehow) send
> the exception back to the starting thread (which is reponsible to
> provide the exception that goes to the client)

I thought having done this correctly but some weeks ago you changed the
logic in the exception reporting in sitemap.Handler back to the starting
thread and I haven't given too much attention on what you've changed.
But looking at the code now I don't see where the problem is.

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: [bug] linking error

Posted by Stefano Mazzocchi <st...@apache.org>.
Giacomo Pati wrote:
> 
> Stefano Mazzocchi wrote:
> >
> > "Craig R. McClanahan" wrote:
> > >
> > > Stefano Mazzocchi wrote:
> > >
> > > > "Craig R. McClanahan" wrote:
> > > >
> > > > > > However, I agree that shared libraries are badly defined in the W3C/XML world.
> > > > > > a) The classes from W3C were never properly packaged and maintained into JAR
> > > > > > files. Every user tend to put them into their own JARs
> > > > > > b) The same classes are not compatible between versions. I can not simply replace
> > > > > > them with the latest version (by compiling and putting them in a JAR in the
> > > > > > lib/ext/ directory) which would temporarily solve my problems.
> > > > > >
> > > > > > But I guess you are on top of this...
> > > > >
> > > > > I wouldn't say necessarily "on top of" -- more "suffering the consequences of" along
> > > > > with everyone else :-).
> > > >
> > > > We appear to suffer more consequences of this than planned.
> > > >
> > > > Here is another pretty serious bug report:
> > > >
> > > > 1) downloaded Tomcat 4.0M1
> > > > 2) latest Cocoon2 from CVS
> > > >
> > > > when executed (Sun JDK 1.3 under Win2k) I get
> > > >
> > > > java.lang.LinkageError: Class org/xml/sax/Attributes violates loader
> > > > constraints
> > > >         at
> > > > _C_._Code._apache_org._jakarta_tomcat_4_0_m1._webapps._cocoon._sitemap_xmap.setConfiguration(_sitemap_xmap.java:480)
> > > >         at
> > > > org.apache.cocoon.sitemap.SitemapHandler.run(SitemapHandler.java:149)
> > > >         at java.lang.Thread.run(Thread.java:479)
> > > >
> > > > but if I remove xerces.jar from /lib everything works just fine.
> > > >
> > > > NOTE: cocoon/WEB-INF/lib *does* include Xerces_1.2.jar along with the
> > > > right SAX classes.
> > > >
> > > > How about that?
> > > >
> > >
> > > I was able to reproduce this, but it fails for me under all three circumstances (xerces.jar in both places, xerces.jar
> > > in $CATALINA_HOME/lib only, and xerces.jar in the Cocoon WEB-INF/lib only).  In the latter case, it complained about a
> > > different class (org.w3c.dom.Document) instead.
> > >
> > > A few comments and questions.
> > >
> > > * According to the Javadocs, a LinkageError means that
> > >   a class was changed this class depended on, without
> > >   recompiling this class.  Is there any chance at all that the
> > >   xerces.jar (from the 1.2 binary download) was not built from
> > >   scratch (build clean then build dist or whatever)?
> > >
> > > * I turned on debugging output in the Catalina class loader.
> > >   It appears that the actual generated sitemap class is being
> > >   started on another thread, using a different classloader.  If
> > >   so, what class is being used, and how is it being configured?
> > >   I don't know enough Cocoon internals to track this down.
> >
> > Oh, shit you're right... didn't think of this...
> >
> > Giacomo, did you use a different classloader for the compiling thread?
> 
> No, I use the XSP engine to compile and instantiate the sitemap. I
> thought all the classloading stuff should happen in the ClassUtils class
> now. But after alook into JavaLanguage I've realized that XSP loads
> class with class.newInstance() and also something about its own
> classloader. Could this be a problem?

I thought I unified all classloading thru ClassUtils... is there some
code that is not using it that way?
 
> >
> > > * Likewise, I don't see anywhere in the code that is writing the
> > >   LinkageError exception message to System.out in the first
> > >   place.  Any ideas where this is coming from?  (The stack trace
> > >   sent back to the browser is a NullPointerException).
> >
> > It's out from the above sitemap compiling thread and the NPE is due to a
> > bug since the two thread are not well communicating... we need to fix
> > that soon.
> 
> Tell me hat the general problem is and I'll fix it (if I'm able to).

Ok, the problem is that if the sitemap cannot be compiled, the exception
triggered to the browser client is a NPE while the real sitemap
exception goes to System.out.

I think this is wrong since the compiling thread should (somehow) send
the exception back to the starting thread (which is reponsible to
provide the exception that goes to the client)

-- 
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: [bug] linking error

Posted by Giacomo Pati <Gi...@pwr.ch>.
Stefano Mazzocchi wrote:
> 
> "Craig R. McClanahan" wrote:
> >
> > Stefano Mazzocchi wrote:
> >
> > > "Craig R. McClanahan" wrote:
> > >
> > > > > However, I agree that shared libraries are badly defined in the W3C/XML world.
> > > > > a) The classes from W3C were never properly packaged and maintained into JAR
> > > > > files. Every user tend to put them into their own JARs
> > > > > b) The same classes are not compatible between versions. I can not simply replace
> > > > > them with the latest version (by compiling and putting them in a JAR in the
> > > > > lib/ext/ directory) which would temporarily solve my problems.
> > > > >
> > > > > But I guess you are on top of this...
> > > >
> > > > I wouldn't say necessarily "on top of" -- more "suffering the consequences of" along
> > > > with everyone else :-).
> > >
> > > We appear to suffer more consequences of this than planned.
> > >
> > > Here is another pretty serious bug report:
> > >
> > > 1) downloaded Tomcat 4.0M1
> > > 2) latest Cocoon2 from CVS
> > >
> > > when executed (Sun JDK 1.3 under Win2k) I get
> > >
> > > java.lang.LinkageError: Class org/xml/sax/Attributes violates loader
> > > constraints
> > >         at
> > > _C_._Code._apache_org._jakarta_tomcat_4_0_m1._webapps._cocoon._sitemap_xmap.setConfiguration(_sitemap_xmap.java:480)
> > >         at
> > > org.apache.cocoon.sitemap.SitemapHandler.run(SitemapHandler.java:149)
> > >         at java.lang.Thread.run(Thread.java:479)
> > >
> > > but if I remove xerces.jar from /lib everything works just fine.
> > >
> > > NOTE: cocoon/WEB-INF/lib *does* include Xerces_1.2.jar along with the
> > > right SAX classes.
> > >
> > > How about that?
> > >
> >
> > I was able to reproduce this, but it fails for me under all three circumstances (xerces.jar in both places, xerces.jar
> > in $CATALINA_HOME/lib only, and xerces.jar in the Cocoon WEB-INF/lib only).  In the latter case, it complained about a
> > different class (org.w3c.dom.Document) instead.
> >
> > A few comments and questions.
> >
> > * According to the Javadocs, a LinkageError means that
> >   a class was changed this class depended on, without
> >   recompiling this class.  Is there any chance at all that the
> >   xerces.jar (from the 1.2 binary download) was not built from
> >   scratch (build clean then build dist or whatever)?
> >
> > * I turned on debugging output in the Catalina class loader.
> >   It appears that the actual generated sitemap class is being
> >   started on another thread, using a different classloader.  If
> >   so, what class is being used, and how is it being configured?
> >   I don't know enough Cocoon internals to track this down.
> 
> Oh, shit you're right... didn't think of this...
> 
> Giacomo, did you use a different classloader for the compiling thread?

No, I use the XSP engine to compile and instantiate the sitemap. I
thought all the classloading stuff should happen in the ClassUtils class
now. But after alook into JavaLanguage I've realized that XSP loads
class with class.newInstance() and also something about its own
classloader. Could this be a problem?

> 
> > * Likewise, I don't see anywhere in the code that is writing the
> >   LinkageError exception message to System.out in the first
> >   place.  Any ideas where this is coming from?  (The stack trace
> >   sent back to the browser is a NullPointerException).
> 
> It's out from the above sitemap compiling thread and the NPE is due to a
> bug since the two thread are not well communicating... we need to fix
> that soon.

Tell me hat the general problem is and I'll fix it (if I'm able to).

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: [bug] linking error

Posted by Stefano Mazzocchi <st...@apache.org>.
"Craig R. McClanahan" wrote:
> 
> Stefano Mazzocchi wrote:
> 
> > "Craig R. McClanahan" wrote:
> >
> > > > However, I agree that shared libraries are badly defined in the W3C/XML world.
> > > > a) The classes from W3C were never properly packaged and maintained into JAR
> > > > files. Every user tend to put them into their own JARs
> > > > b) The same classes are not compatible between versions. I can not simply replace
> > > > them with the latest version (by compiling and putting them in a JAR in the
> > > > lib/ext/ directory) which would temporarily solve my problems.
> > > >
> > > > But I guess you are on top of this...
> > >
> > > I wouldn't say necessarily "on top of" -- more "suffering the consequences of" along
> > > with everyone else :-).
> >
> > We appear to suffer more consequences of this than planned.
> >
> > Here is another pretty serious bug report:
> >
> > 1) downloaded Tomcat 4.0M1
> > 2) latest Cocoon2 from CVS
> >
> > when executed (Sun JDK 1.3 under Win2k) I get
> >
> > java.lang.LinkageError: Class org/xml/sax/Attributes violates loader
> > constraints
> >         at
> > _C_._Code._apache_org._jakarta_tomcat_4_0_m1._webapps._cocoon._sitemap_xmap.setConfiguration(_sitemap_xmap.java:480)
> >         at
> > org.apache.cocoon.sitemap.SitemapHandler.run(SitemapHandler.java:149)
> >         at java.lang.Thread.run(Thread.java:479)
> >
> > but if I remove xerces.jar from /lib everything works just fine.
> >
> > NOTE: cocoon/WEB-INF/lib *does* include Xerces_1.2.jar along with the
> > right SAX classes.
> >
> > How about that?
> >
> 
> I was able to reproduce this, but it fails for me under all three circumstances (xerces.jar in both places, xerces.jar
> in $CATALINA_HOME/lib only, and xerces.jar in the Cocoon WEB-INF/lib only).  In the latter case, it complained about a
> different class (org.w3c.dom.Document) instead.
> 
> A few comments and questions.
> 
> * According to the Javadocs, a LinkageError means that
>   a class was changed this class depended on, without
>   recompiling this class.  Is there any chance at all that the
>   xerces.jar (from the 1.2 binary download) was not built from
>   scratch (build clean then build dist or whatever)?
> 
> * I turned on debugging output in the Catalina class loader.
>   It appears that the actual generated sitemap class is being
>   started on another thread, using a different classloader.  If
>   so, what class is being used, and how is it being configured?
>   I don't know enough Cocoon internals to track this down.

Oh, shit you're right... didn't think of this...

Giacomo, did you use a different classloader for the compiling thread?
 
> * Likewise, I don't see anywhere in the code that is writing the
>   LinkageError exception message to System.out in the first
>   place.  Any ideas where this is coming from?  (The stack trace
>   sent back to the browser is a NullPointerException).

It's out from the above sitemap compiling thread and the NPE is due to a
bug since the two thread are not well communicating... we need to fix
that soon.

-- 
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: [bug] linking error

Posted by Stefano Mazzocchi <st...@apache.org>.
"Craig R. McClanahan" wrote:
> 
> Stefano Mazzocchi wrote:
> 
> > "Craig R. McClanahan" wrote:
> >
> > > > However, I agree that shared libraries are badly defined in the W3C/XML world.
> > > > a) The classes from W3C were never properly packaged and maintained into JAR
> > > > files. Every user tend to put them into their own JARs
> > > > b) The same classes are not compatible between versions. I can not simply replace
> > > > them with the latest version (by compiling and putting them in a JAR in the
> > > > lib/ext/ directory) which would temporarily solve my problems.
> > > >
> > > > But I guess you are on top of this...
> > >
> > > I wouldn't say necessarily "on top of" -- more "suffering the consequences of" along
> > > with everyone else :-).
> >
> > We appear to suffer more consequences of this than planned.
> >
> > Here is another pretty serious bug report:
> >
> > 1) downloaded Tomcat 4.0M1
> > 2) latest Cocoon2 from CVS
> >
> > when executed (Sun JDK 1.3 under Win2k) I get
> >
> > java.lang.LinkageError: Class org/xml/sax/Attributes violates loader
> > constraints
> >         at
> > _C_._Code._apache_org._jakarta_tomcat_4_0_m1._webapps._cocoon._sitemap_xmap.setConfiguration(_sitemap_xmap.java:480)
> >         at
> > org.apache.cocoon.sitemap.SitemapHandler.run(SitemapHandler.java:149)
> >         at java.lang.Thread.run(Thread.java:479)
> >
> > but if I remove xerces.jar from /lib everything works just fine.
> >
> > NOTE: cocoon/WEB-INF/lib *does* include Xerces_1.2.jar along with the
> > right SAX classes.
> >
> > How about that?
> >
> 
> I was able to reproduce this, but it fails for me under all three circumstances (xerces.jar in both places, xerces.jar
> in $CATALINA_HOME/lib only, and xerces.jar in the Cocoon WEB-INF/lib only).  In the latter case, it complained about a
> different class (org.w3c.dom.Document) instead.
> 
> A few comments and questions.
> 
> * According to the Javadocs, a LinkageError means that
>   a class was changed this class depended on, without
>   recompiling this class.  Is there any chance at all that the
>   xerces.jar (from the 1.2 binary download) was not built from
>   scratch (build clean then build dist or whatever)?
> 
> * I turned on debugging output in the Catalina class loader.
>   It appears that the actual generated sitemap class is being
>   started on another thread, using a different classloader.  If
>   so, what class is being used, and how is it being configured?
>   I don't know enough Cocoon internals to track this down.

Oh, shit you're right... didn't think of this...

Giacomo, did you use a different classloader for the compiling thread?
 
> * Likewise, I don't see anywhere in the code that is writing the
>   LinkageError exception message to System.out in the first
>   place.  Any ideas where this is coming from?  (The stack trace
>   sent back to the browser is a NullPointerException).

It's out from the above sitemap compiling thread and the NPE is due to a
bug since the two thread are not well communicating... we need to fix
that soon.

-- 
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: [bug] linking error

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Stefano Mazzocchi wrote:

> "Craig R. McClanahan" wrote:
>
> > > However, I agree that shared libraries are badly defined in the W3C/XML world.
> > > a) The classes from W3C were never properly packaged and maintained into JAR
> > > files. Every user tend to put them into their own JARs
> > > b) The same classes are not compatible between versions. I can not simply replace
> > > them with the latest version (by compiling and putting them in a JAR in the
> > > lib/ext/ directory) which would temporarily solve my problems.
> > >
> > > But I guess you are on top of this...
> >
> > I wouldn't say necessarily "on top of" -- more "suffering the consequences of" along
> > with everyone else :-).
>
> We appear to suffer more consequences of this than planned.
>
> Here is another pretty serious bug report:
>
> 1) downloaded Tomcat 4.0M1
> 2) latest Cocoon2 from CVS
>
> when executed (Sun JDK 1.3 under Win2k) I get
>
> java.lang.LinkageError: Class org/xml/sax/Attributes violates loader
> constraints
>         at
> _C_._Code._apache_org._jakarta_tomcat_4_0_m1._webapps._cocoon._sitemap_xmap.setConfiguration(_sitemap_xmap.java:480)
>         at
> org.apache.cocoon.sitemap.SitemapHandler.run(SitemapHandler.java:149)
>         at java.lang.Thread.run(Thread.java:479)
>
> but if I remove xerces.jar from /lib everything works just fine.
>
> NOTE: cocoon/WEB-INF/lib *does* include Xerces_1.2.jar along with the
> right SAX classes.
>
> How about that?
>

I was able to reproduce this, but it fails for me under all three circumstances (xerces.jar in both places, xerces.jar
in $CATALINA_HOME/lib only, and xerces.jar in the Cocoon WEB-INF/lib only).  In the latter case, it complained about a
different class (org.w3c.dom.Document) instead.

A few comments and questions.

* According to the Javadocs, a LinkageError means that
  a class was changed this class depended on, without
  recompiling this class.  Is there any chance at all that the
  xerces.jar (from the 1.2 binary download) was not built from
  scratch (build clean then build dist or whatever)?

* I turned on debugging output in the Catalina class loader.
  It appears that the actual generated sitemap class is being
  started on another thread, using a different classloader.  If
  so, what class is being used, and how is it being configured?
  I don't know enough Cocoon internals to track this down.

* Likewise, I don't see anywhere in the code that is writing the
  LinkageError exception message to System.out in the first
  place.  Any ideas where this is coming from?  (The stack trace
  sent back to the browser is a NullPointerException).

>
> --
> Stefano Mazzocchi      One must still have chaos in oneself to be
>

Craig

====================
See you at ApacheCon Europe <http://www.apachecon.com>!
Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
                                    Applications to Tomcat



Re: [bug] linking error

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Stefano Mazzocchi wrote:

> "Craig R. McClanahan" wrote:
>
> > > However, I agree that shared libraries are badly defined in the W3C/XML world.
> > > a) The classes from W3C were never properly packaged and maintained into JAR
> > > files. Every user tend to put them into their own JARs
> > > b) The same classes are not compatible between versions. I can not simply replace
> > > them with the latest version (by compiling and putting them in a JAR in the
> > > lib/ext/ directory) which would temporarily solve my problems.
> > >
> > > But I guess you are on top of this...
> >
> > I wouldn't say necessarily "on top of" -- more "suffering the consequences of" along
> > with everyone else :-).
>
> We appear to suffer more consequences of this than planned.
>
> Here is another pretty serious bug report:
>
> 1) downloaded Tomcat 4.0M1
> 2) latest Cocoon2 from CVS
>
> when executed (Sun JDK 1.3 under Win2k) I get
>
> java.lang.LinkageError: Class org/xml/sax/Attributes violates loader
> constraints
>         at
> _C_._Code._apache_org._jakarta_tomcat_4_0_m1._webapps._cocoon._sitemap_xmap.setConfiguration(_sitemap_xmap.java:480)
>         at
> org.apache.cocoon.sitemap.SitemapHandler.run(SitemapHandler.java:149)
>         at java.lang.Thread.run(Thread.java:479)
>
> but if I remove xerces.jar from /lib everything works just fine.
>
> NOTE: cocoon/WEB-INF/lib *does* include Xerces_1.2.jar along with the
> right SAX classes.
>
> How about that?
>

I was able to reproduce this, but it fails for me under all three circumstances (xerces.jar in both places, xerces.jar
in $CATALINA_HOME/lib only, and xerces.jar in the Cocoon WEB-INF/lib only).  In the latter case, it complained about a
different class (org.w3c.dom.Document) instead.

A few comments and questions.

* According to the Javadocs, a LinkageError means that
  a class was changed this class depended on, without
  recompiling this class.  Is there any chance at all that the
  xerces.jar (from the 1.2 binary download) was not built from
  scratch (build clean then build dist or whatever)?

* I turned on debugging output in the Catalina class loader.
  It appears that the actual generated sitemap class is being
  started on another thread, using a different classloader.  If
  so, what class is being used, and how is it being configured?
  I don't know enough Cocoon internals to track this down.

* Likewise, I don't see anywhere in the code that is writing the
  LinkageError exception message to System.out in the first
  place.  Any ideas where this is coming from?  (The stack trace
  sent back to the browser is a NullPointerException).

>
> --
> Stefano Mazzocchi      One must still have chaos in oneself to be
>

Craig

====================
See you at ApacheCon Europe <http://www.apachecon.com>!
Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
                                    Applications to Tomcat