Uploaded image for project: 'TomEE'
  1. TomEE
  2. TOMEE-667

Deploy an ejb module with persistence.xml file cause: attempted duplicate class definition for name: "org/apache/openejb/cdi/CdiPlugin"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5.1
    • 1.5.2
    • None
    • Apache TomEE 1.5.1 Final Release

    Description

      If you try to deploy an ejbmodule with use a persistence.xml you get an exception.

      This exception not happend if you COMMENT this line in catalina.sh

      if [ -r "$CATALINA_HOME"/lib/openejb-javaagent.jar ]; then
      JAVA_OPTS=""-javaagent:$CATALINA_HOME/lib/openejb-javaagent.jar" $JAVA_OPTS"
      fi

      Here is the log information about the error:

      SEVERE: Application could not be deployed: /home/maxtorzito/tomee/apache-tomee-webprofile-1.5.2-SNAPSHOT_19-12-2012/apps/myejbmodule-1.0-SNAPSHOT.jar
      org.apache.openejb.OpenEJBException: Creating application failed: /home/maxtorzito/tomee/apache-tomee-webprofile-1.5.2-SNAPSHOT_19-12-2012/apps/myejbmodule-1.0-SNAPSHOT.jar: loader (instance of org/apache/catalina/loader/StandardClassLoader): attempted duplicate class definition for name: "org/apache/openejb/cdi/CdiPlugin"
      at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:823)
      at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:534)
      at org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:433)
      at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:341)
      at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:144)
      at org.apache.openejb.OpenEJB.init(OpenEJB.java:290)
      at org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:233)
      at org.apache.tomee.catalina.TomcatLoader.init(TomcatLoader.java:130)
      at org.apache.tomee.catalina.ServerListener.lifecycleEvent(ServerListener.java:121)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
      at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
      at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
      at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:110)
      at org.apache.catalina.startup.Catalina.load(Catalina.java:633)
      at org.apache.catalina.startup.Catalina.load(Catalina.java:658)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450)
      Caused by: java.lang.LinkageError: loader (instance of org/apache/catalina/loader/StandardClassLoader): attempted duplicate class definition for name: "org/apache/openejb/cdi/CdiPlugin"
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:410)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
      at org.apache.openejb.cdi.OptimizedLoaderService.loadWebBeansPlugins(OptimizedLoaderService.java:87)
      at org.apache.openejb.cdi.OptimizedLoaderService.load(OptimizedLoaderService.java:57)
      at org.apache.openejb.cdi.OptimizedLoaderService.load(OptimizedLoaderService.java:51)
      at org.apache.webbeans.plugins.PluginLoader.startUp(PluginLoader.java:75)
      at org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:159)
      at org.apache.openejb.cdi.ThreadSingletonServiceImpl.initialize(ThreadSingletonServiceImpl.java:150)
      at org.apache.openejb.cdi.CdiBuilder.build(CdiBuilder.java:44)
      at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:711)
      ... 20 more

      Attachments

        Activity

          People

            romain.manni-bucau Romain Manni-Bucau
            maxtorzito José Luis Cetina (maxtorzito)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: