2 Replies Latest reply on Nov 25, 2003 5:58 AM by Magnus Mickelsson

    java.lang.LinkageError: loader constraints violated when lin

    Sascha Newbie

      Hi,

      I'm using JBoss 3.0.3 with Tomcat 4.1 and Struts 1.1.

      After deploying my project and executing a JSP using a Action, I get the following error:
      2003-09-10 11:10:56,164 ERROR [org.jboss.web.localhost.Engine] ----- Root Cause -----
      java.lang.LinkageError: loader constraints violated when linking org/apache/struts/action/ActionServlet class
      at org.apache.struts.action.ActionServlet.getRequestProcessor(ActionServlet.java:872)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
      at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:469)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1040)
      at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1151)
      at java.lang.Thread.run(Thread.java:534)

      What does this mean? Where is it coming from?

        • 1. Re: java.lang.LinkageError: loader constraints violated when
          chran554 Newbie

          Hi, unfortunately I get the same error. As I'm new to the whole webapplication jboss/tomcat/struts thing I'm a bit confused since I do not know what I've done wrong.

          Is there someone out there that - please - can share a light on this?
          To restart jboss everytime you need to deploy is mayhem.

          Got the same message as previous post...
          jboss-3.2.2RC4 (with Tomcat)
          jakarta-struts-1.1

          • 2. Re: java.lang.LinkageError: loader constraints violated when
            Magnus Mickelsson Newbie

            > Hi, unfortunately I get the same error. As I'm new to
            > the whole webapplication jboss/tomcat/struts thing
            > I'm a bit confused since I do not know what I've done
            > wrong.

            Short version: Your classpath dependencies and/or JAR file placement is probably messed up. Review how you do your J2EE packaging.

            Longer version:
            Ask yourself if you have files outside of your WAR, EAR or similar that you're linking to. Do you for instance link any classes in /server/default/lib/?

            I'd recommend you use for instance JWhich (http://www.clarkware.com/) to find out from which resource a class has been loaded. Also, you can turn on tracing in the JBoss logs for class loading.

            Try creating a JWhichEJB and a JWhichServlet you can call to find out what resource certain classes are loaded from in your respective WAR or EJB-JAR archive.

            I recommend you get your hands on the commercial docs, where this issue of LinkageError is explained (and also how you can enable tracing of class loading).

            JBoss has some issues with redeployment, that much is true. I have examples of where it works to redeploy nicely, but also when it does not work. I am quite sure though that this issue I'm having is also packaging related...

            HTH, Magnus