0 Replies Latest reply on Jan 10, 2011 12:10 PM by Ohad Zeliger

    java.lang.LinkageError with two EARs that have beans.xml

    Ohad Zeliger Newbie

      Hi,

       

      While creating an example of Weld and Jboss AS6 (Final), I ran into the following error:

       

      Caused by: java.lang.LinkageError: loader (instance of  org/jboss/classloader/spi/base/BaseClassLoader):

      attempted  duplicate class definition for name:

      "org/jboss/weld/examples/translator/web/org$jboss$weld$bean-jboss$classloader:id=

      "vfs:$$$users$oz$projects$weld-example$ear$target$weld-translator-web$ear"

      -NewSessionBean-TranslatorControllerBean_$$_WeldProxy"

          at java.lang.ClassLoader.defineClass1(Native Method) [:1.6.0_20]

          at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) [:1.6.0_20]

          at java.lang.ClassLoader.defineClass(ClassLoader.java:616) [:1.6.0_20]

          at java.lang.ClassLoader.defineClass(ClassLoader.java:466) [:1.6.0_20]

          at sun.reflect.GeneratedMethodAccessor129.invoke(Unknown Source) [:1.6.0_20]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_20]

          at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_20]

          at org.jboss.weld.util.bytecode.ClassFileUtils.toClass2(ClassFileUtils.java:143) [:6.0.0.Final]

          at org.jboss.weld.util.bytecode.ClassFileUtils.toClass(ClassFileUtils.java:109) [:6.0.0.Final]

       

       

      The configuration contains two EAR files, ear1 with a WAR (that contains the JSF code) and an ejb-jar and ear2 containing ejb-jar only.

      the error appears when both ejb-jars and the war contain a beans.xml file. The system loads fine when ear2's ejb-jar does not contain a beans.xml file.

       

      Your help is greatly appreciated