[prev in list] [next in list] [prev in thread] [next in thread] 

List:       taglibs-user
Subject:    Re: [Standard] Loader constraints violation
From:       "Ted Neward" <tneward () javageeks ! com>
Date:       2002-01-24 4:50:01
[Download RAW message or body]

That is, without a doubt, the first time I've ever seen that message in the
wild. The javadocs read

"Subclasses of LinkageError indicate that a class has some dependency on
another class; however, the latter class has incompatibly changed after the
compilation of the former class. "

What I'm betting is that somehow the ClassLoader dependency tree is tripping
you up. Let me try and abstract the problem out to explain it.

Class A was compiled using class B version 1. A now has a dependency on
B(1), and when A is loaded, the dependency on B is noted and B is
immediately load-attempted. Normally, if B is not present, you get the
ClassNotFoundException; however, what I *think* is happening is that another
version of B, call it version 2, has already been loaded by a ClassLoader
higher up on the ClassLoader delegation chain[1]--therefore, when A's
dependency on B is seen, an immediate load-check is made to load B. B is
already loaded, so the VM doesn't attempt to reload it. But the B already
loaded is version 2, which doesn't match up with what A was expecting, so
the VM panics and throws the LinkageError.

If I were particularly industrious, I'd try to recreate this scenario in a
simple test to verify the thought--but unfortunately I'm not feeling that
industrious. :) I'd take a look at what else is in your Tomcat common\lib as
well as your JRE's CLASSPATH and Extensions settings, and see if you can't
find an earlier version of Xalan somewhere there. That could possibly cause
what you're seeing.

All of this is under HUGE disclaimer: this is just a hypothesis.

Ted Neward
{.NET || Java} Course Author & Instructor, DevelopMentor
(http://www.develop.com)
http://www.javageeks.com/tneward

[1] See either Bill Venners "Inside the Java2 Virtual Machine", or my
"Server-Based Java Programming", or check out my papers at
www.javageeks.com/Papers, or email Gilad Bracha at Sun for more details.

----- Original Message -----
From: "Ryan Lubke" <Ryan.Lubke@Sun.COM>
To: <taglibs-user@jakarta.apache.org>
Sent: Tuesday, January 22, 2002 3:12 PM
Subject: [Standard] Loader constraints violation


> Hi,
>
> Just curious about this.  I've build the standard taglibs distribution
> from the HEAD branch in CVS and am running with Tomcat 4.0 from the HEAD
> branch in CVS.  In some cases, like submitting the driver and URL in the
> SQL examples of the standard-examples application, I receive the
> following:
>
> <stacktrace>
>
> java.lang.LinkageError: loader constraints violated when linking
> org/xml/sax/helpers/DefaultHandler class
>         at
> org.apache.taglibs.standard.tlv.JstlBaseTLV.validate(JstlBaseTLV.java:164)
>         at
>
org.apache.jasper.compiler.TagLibraryInfoImpl.validate(TagLibraryInfoImpl.ja
va:614)
>         at
>
org.apache.jasper.compiler.JspParseEventListener.validate(JspParseEventListe
ner.java:1128)
>         at
> org.apache.jasper.compiler.Compiler.compile(Compiler.java:219)
>         at
> org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:551)
>         at
>
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspSe
rvlet.java:177)
>         at
>
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:189)
>         at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
>         at
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>
> </stacktrace>
>
> Looks like the problem is due to the presense of xalan.jar in
> WEB-INF/lib.  If this jar is removed, then I'm fine until I invoke
> any of the XML examples.  Then I'm subjected to a NoClassDefFoundError:
> javax/xml/transform/Result.
>
> The workaround at this point is to move xalan.jar to
> $CATALINA_HOME/common/lib.
>
> Anyone hit similar issues when running the examples?
>
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:taglibs-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:taglibs-user-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-user-help@jakarta.apache.org>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic