4 Replies Latest reply on May 4, 2011 1:21 PM by thescientist

    LinkageError (Migrating to 6.0.0 Final)

    thescientist

      Hello

      while migrating a bigger project from 4.2.3 to JBoss6 i get a LinkageError (see Attachement).

      Yes there are two files containing JExamObject (ear and lib), but they have the same version and the error didn't occur in the older JBoss versions.

      So my question is, has something changed in JBoss which could be the reason for the error or where else could I search for the reason (maybe jboss-cache 1.4.1 not compatible to JBoss6).

       

      Thanks in Advance

       

      Stefan

        • 1. LinkageError (Migrating to 6.0.0 Final)
          wdfink

          If you look to the first message the problem is that the classes are loaded by two different class loaders.

          This might happen if a class reference is given across different archives which are loaded by different class loaders.

          In your case I suppose that the EAR contain one and the JAR is located in the server/.../lib folder.

          In this case the lib/jar is loaded by the global classloader and the ear in a separate one to isolate the application.

          • 2. LinkageError (Migrating to 6.0.0 Final)
            thescientist

            So what's the smartest way to solve the problem.

            Like i said it's a big project developed over more than ten years.
            Is it possible to force the use of a class loader, or find the "bad" references?

            • 3. LinkageError (Migrating to 6.0.0 Final)
              wdfink

              I suppose that you have communication between different application EAR/WAR's in the same JBoss.

              One solution might that you use 'call by value' instead of 'call by reference' (which is also the JEE standard).

              But this will be slower because of serialisation ...

               

              Other solution is to load all classes in the same classloader scope.

              See wiki to have a clear picture of this

              http://community.jboss.org/wiki/JBossClassLoadingUseCases

               

              I know this is not an easy issue but it is indispensable to have knowlegde about the behaviour.

              1 of 1 people found this helpful
              • 4. LinkageError (Migrating to 6.0.0 Final)
                thescientist

                thank you for the help,

                i finally found the error in the our own old cache manager implementation, which just needed to be removed.