1 2 Previous Next 17 Replies Latest reply: Apr 22, 2013 6:19 AM by Dominik Grupp RSS

duplicate class definition for name: org/jboss/weldx/persistence/EntityManager

Michael Wittig Newbie

Hi,

 

I get some strange exception when I Inject the EntityManager:

 

@Singleton
@Startup
public class TestJMS {


rivate Queue test;
  
          @Inject
          private EntityManager em;
  
          @PostConstruct
          public final void setUp() {
                    System.out.println(this.em.isOpen());
          }
}

 

public class Resources {


   @SuppressWarnings("unused")
   @Produces
   @PersistenceContext(unitName = "pool")
   private EntityManager em;
   
   @Produces
   public Logger produceLog(InjectionPoint injectionPoint) {
      return Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getName());
   }
}

 

The Exception looks like this:

 

14:00:30,268 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed to start service jboss.deployment.subunit."server-ear.ear"."server-ejb-1.0.0-SNAPSHOT.jar".component.RandomRawPriceImporterService.START: org.jboss.msc.service.StartException in service jboss.deployment.subunit."server-ear.ear"."server-ejb-1.0.0-SNAPSHOT.jar".component.RandomRawPriceImporterService.START: Failed to start service
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_03]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_03]
          at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03]
Caused by: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance
          at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:163)
          at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:85)
          at org.jboss.as.ejb3.component.singleton.SingletonComponent.getComponentInstance(SingletonComponent.java:116)
          at org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:130)
          at org.jboss.as.ee.component.ComponentStartService.start(ComponentStartService.java:44)
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
          ... 3 more
Caused by: javax.ejb.EJBException: org.jboss.weld.exceptions.WeldException: by java.lang.LinkageError: loader (instance of  org/jboss/modules/ModuleClassLoader): attempted  duplicate class definition for name: "org/jboss/weldx/persistence/EntityManager$-1701224127$Proxy$_$$_Weld$Proxy$"
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:166)
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:230)
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:333)
          at org.jboss.as.ejb3.tx.SingletonLifecycleCMTTxInterceptor.processInvocation(SingletonLifecycleCMTTxInterceptor.java:56)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
          at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
          at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
          at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161)
          ... 9 more
Caused by: org.jboss.weld.exceptions.WeldException: by java.lang.LinkageError: loader (instance of  org/jboss/modules/ModuleClassLoader): attempted  duplicate class definition for name: "org/jboss/weldx/persistence/EntityManager$-1701224127$Proxy$_$$_Weld$Proxy$"
          at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:275)
          at org.jboss.weld.bean.proxy.ProxyFactory.create(ProxyFactory.java:235)
          at org.jboss.weld.bean.builtin.ee.EEResourceProducerField.create(EEResourceProducerField.java:137)
          at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:61)
          at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:616)
          at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:681)
          at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:118)
          at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:703)
          at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:712)
          at org.jboss.weld.bean.SessionBean$1$1.proceed(SessionBean.java:176)
          at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48)
          at org.jboss.weld.bean.SessionBean$1.inject(SessionBean.java:173)
          at org.jboss.as.weld.injection.WeldEEInjection.inject(WeldEEInjection.java:78)
          at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:60)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
          at org.jboss.as.ee.component.ManagedReferenceInterceptorFactory$ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptorFactory.java:95)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
          at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
          at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:228)
          ... 18 more
Caused by: javassist.CannotCompileException: by java.lang.LinkageError: loader (instance of  org/jboss/modules/ModuleClassLoader): attempted  duplicate class definition for name: "org/jboss/weldx/persistence/EntityManager$-1701224127$Proxy$_$$_Weld$Proxy$"
          at org.jboss.weld.util.bytecode.ClassFileUtils.toClass(ClassFileUtils.java:99)
          at org.jboss.weld.bean.proxy.ProxyFactory.createProxyClass(ProxyFactory.java:377)
          at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:273)
          ... 39 more
Caused by: java.lang.LinkageError: loader (instance of  org/jboss/modules/ModuleClassLoader): attempted  duplicate class definition for name: "org/jboss/weldx/persistence/EntityManager$-1701224127$Proxy$_$$_Weld$Proxy$"
          at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_03]
          at java.lang.ClassLoader.defineClass(ClassLoader.java:791) [rt.jar:1.7.0_03]
          at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source) [:1.7.0_03]
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_03]
          at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_03]
          at org.jboss.weld.util.bytecode.ClassFileUtils.toClass2(ClassFileUtils.java:118)
          at org.jboss.weld.util.bytecode.ClassFileUtils.toClass(ClassFileUtils.java:95)
          ... 41 more


14:00:30,268 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.subunit."server-ear.ear"."server-ejb-1.0.0-SNAPSHOT.jar".component.TestJMS.START: org.jboss.msc.service.StartException in service jboss.deployment.subunit."server-ear.ear"."server-ejb-1.0.0-SNAPSHOT.jar".component.TestJMS.START: Failed to start service
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_03]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_03]
          at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03]
Caused by: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance
          at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:163)
          at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:85)
          at org.jboss.as.ejb3.component.singleton.SingletonComponent.getComponentInstance(SingletonComponent.java:116)
          at org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:130)
          at org.jboss.as.ee.component.ComponentStartService.start(ComponentStartService.java:44)
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
          ... 3 more
Caused by: javax.ejb.EJBException: org.jboss.weld.exceptions.WeldException: by java.lang.LinkageError: loader (instance of  org/jboss/modules/ModuleClassLoader): attempted  duplicate class definition for name: "org/jboss/weldx/persistence/EntityManager$-1701224127$Proxy$_$$_Weld$Proxy$"
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:166)
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:230)
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:333)
          at org.jboss.as.ejb3.tx.SingletonLifecycleCMTTxInterceptor.processInvocation(SingletonLifecycleCMTTxInterceptor.java:56)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
          at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161)
          ... 9 more
Caused by: org.jboss.weld.exceptions.WeldException: by java.lang.LinkageError: loader (instance of  org/jboss/modules/ModuleClassLoader): attempted  duplicate class definition for name: "org/jboss/weldx/persistence/EntityManager$-1701224127$Proxy$_$$_Weld$Proxy$"
          at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:275)
          at org.jboss.weld.bean.proxy.ProxyFactory.create(ProxyFactory.java:235)
          at org.jboss.weld.bean.builtin.ee.EEResourceProducerField.create(EEResourceProducerField.java:137)
          at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:61)
          at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:616)
          at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:681)
          at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:118)
          at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:703)
          at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:712)
          at org.jboss.weld.bean.SessionBean$1$1.proceed(SessionBean.java:176)
          at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48)
          at org.jboss.weld.bean.SessionBean$1.inject(SessionBean.java:173)
          at org.jboss.as.weld.injection.WeldEEInjection.inject(WeldEEInjection.java:78)
          at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:60)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptorFactory$ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptorFactory.java:112)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptorFactory$ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptorFactory.java:112)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ee.component.ManagedReferenceInterceptorFactory$ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptorFactory.java:95)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:228)
          ... 18 more
Caused by: javassist.CannotCompileException: by java.lang.LinkageError: loader (instance of  org/jboss/modules/ModuleClassLoader): attempted  duplicate class definition for name: "org/jboss/weldx/persistence/EntityManager$-1701224127$Proxy$_$$_Weld$Proxy$"
          at org.jboss.weld.util.bytecode.ClassFileUtils.toClass(ClassFileUtils.java:99)
          at org.jboss.weld.bean.proxy.ProxyFactory.createProxyClass(ProxyFactory.java:377)
          at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:273)
          ... 45 more
Caused by: java.lang.LinkageError: loader (instance of  org/jboss/modules/ModuleClassLoader): attempted  duplicate class definition for name: "org/jboss/weldx/persistence/EntityManager$-1701224127$Proxy$_$$_Weld$Proxy$"
          at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_03]
          at java.lang.ClassLoader.defineClass(ClassLoader.java:791) [rt.jar:1.7.0_03]
          at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source) [:1.7.0_03]
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_03]
          at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_03]
          at org.jboss.weld.util.bytecode.ClassFileUtils.toClass2(ClassFileUtils.java:118)
          at org.jboss.weld.util.bytecode.ClassFileUtils.toClass(ClassFileUtils.java:95)
          ... 47 more


14:00:30,268 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.subunit."server-ear.ear"."server-ejb-1.0.0-SNAPSHOT.jar".component.TccCacheBean.START: org.jboss.msc.service.StartException in service jboss.deployment.subunit."server-ear.ear"."server-ejb-1.0.0-SNAPSHOT.jar".component.TccCacheBean.START: Failed to start service
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_03]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_03]
          at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03]
Caused by: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance
          at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:163)
          at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:85)
          at org.jboss.as.ejb3.component.singleton.SingletonComponent.getComponentInstance(SingletonComponent.java:116)
          at org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:130)
          at org.jboss.as.ee.component.ComponentStartService.start(ComponentStartService.java:44)
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
          ... 3 more
Caused by: javax.ejb.EJBException: org.jboss.weld.exceptions.WeldException: by java.lang.LinkageError: loader (instance of  org/jboss/modules/ModuleClassLoader): attempted  duplicate class definition for name: "org/jboss/weldx/persistence/EntityManager$-1701224127$Proxy$_$$_Weld$Proxy$"
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:166)
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:230)
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:333)
          at org.jboss.as.ejb3.tx.SingletonLifecycleCMTTxInterceptor.processInvocation(SingletonLifecycleCMTTxInterceptor.java:56)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
          at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161)
          ... 9 more
Caused by: org.jboss.weld.exceptions.WeldException: by java.lang.LinkageError: loader (instance of  org/jboss/modules/ModuleClassLoader): attempted  duplicate class definition for name: "org/jboss/weldx/persistence/EntityManager$-1701224127$Proxy$_$$_Weld$Proxy$"
          at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:275)
          at org.jboss.weld.bean.proxy.ProxyFactory.create(ProxyFactory.java:235)
          at org.jboss.weld.bean.builtin.ee.EEResourceProducerField.create(EEResourceProducerField.java:137)
          at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:61)
          at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:616)
          at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:681)
          at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:118)
          at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:703)
          at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:712)
          at org.jboss.weld.bean.SessionBean$1$1.proceed(SessionBean.java:176)
          at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48)
          at org.jboss.weld.bean.SessionBean$1.inject(SessionBean.java:173)
          at org.jboss.as.weld.injection.WeldEEInjection.inject(WeldEEInjection.java:78)
          at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:60)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ee.component.ManagedReferenceInterceptorFactory$ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptorFactory.java:95)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:228)
          ... 18 more
Caused by: javassist.CannotCompileException: by java.lang.LinkageError: loader (instance of  org/jboss/modules/ModuleClassLoader): attempted  duplicate class definition for name: "org/jboss/weldx/persistence/EntityManager$-1701224127$Proxy$_$$_Weld$Proxy$"
          at org.jboss.weld.util.bytecode.ClassFileUtils.toClass(ClassFileUtils.java:99)
          at org.jboss.weld.bean.proxy.ProxyFactory.createProxyClass(ProxyFactory.java:377)
          at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:273)
          ... 39 more
Caused by: java.lang.LinkageError: loader (instance of  org/jboss/modules/ModuleClassLoader): attempted  duplicate class definition for name: "org/jboss/weldx/persistence/EntityManager$-1701224127$Proxy$_$$_Weld$Proxy$"
          at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_03]
          at java.lang.ClassLoader.defineClass(ClassLoader.java:791) [rt.jar:1.7.0_03]
          at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source) [:1.7.0_03]
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_03]
          at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_03]
          at org.jboss.weld.util.bytecode.ClassFileUtils.toClass2(ClassFileUtils.java:118)
          at org.jboss.weld.util.bytecode.ClassFileUtils.toClass(ClassFileUtils.java:95)
          ... 41 more


14:00:30,331 INFO  [org.jboss.as] (MSC service thread 1-1) JBAS015951: Admin console listening on http://127.0.0.1:10190
14:00:30,331 ERROR [org.jboss.as] (MSC service thread 1-1) JBAS015875: JBoss AS 7.1.1.Final "Brontes" started (with errors) in 7258ms - Started 604 of 691 services (3 services failed or missing dependencies, 80 services are passive or on-demand)
14:00:30,346 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "server-ear.ear" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.subunit.\"server-ear.ear\".\"server-ejb-1.0.0-SNAPSHOT.jar\".component.TestJMS.START" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"server-ear.ear\".\"server-ejb-1.0.0-SNAPSHOT.jar\".component.TestJMS.START: Failed to start service","jboss.deployment.subunit.\"server-ear.ear\".\"server-ejb-1.0.0-SNAPSHOT.jar\".component.TccCacheBean.START" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"server-ear.ear\".\"server-ejb-1.0.0-SNAPSHOT.jar\".component.TccCacheBean.START: Failed to start service","jboss.deployment.subunit.\"server-ear.ear\".\"server-ejb-1.0.0-SNAPSHOT.jar\".component.RandomRawPriceImporterService.START" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"server-ear.ear\".\"server-ejb-1.0.0-SNAPSHOT.jar\".component.RandomRawPriceImporterService.START: Failed to start service"}}
14:00:30,393 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016009: Stopping weld service for deployment server-ear.ear
14:00:30,393 INFO  [org.jboss.as.jpa] (MSC service thread 1-5) JBAS011403: Stopping Persistence Unit Service 'server-ear.ear/server-ejb-1.0.0-SNAPSHOT.jar#pool'
14:00:30,409 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015877: Stopped deployment server-ejb-1.0.0-SNAPSHOT.jar in 64ms
14:00:30,424 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015877: Stopped deployment server-ear.ear in 82ms
14:00:30,424 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014777:   Services which failed to start:      service jboss.deployment.subunit."server-ear.ear"."server-ejb-1.0.0-SNAPSHOT.jar".component.TestJMS.START: org.jboss.msc.service.StartException in service jboss.deployment.subunit."server-ear.ear"."server-ejb-1.0.0-SNAPSHOT.jar".component.TestJMS.START: Failed to start service
      service jboss.deployment.subunit."server-ear.ear"."server-ejb-1.0.0-SNAPSHOT.jar".component.RandomRawPriceImporterService.START: org.jboss.msc.service.StartException in service jboss.deployment.subunit."server-ear.ear"."server-ejb-1.0.0-SNAPSHOT.jar".component.RandomRawPriceImporterService.START: Failed to start service
      service jboss.deployment.subunit."server-ear.ear"."server-ejb-1.0.0-SNAPSHOT.jar".component.TccCacheBean.START: org.jboss.msc.service.StartException in service jboss.deployment.subunit."server-ear.ear"."server-ejb-1.0.0-SNAPSHOT.jar".component.TccCacheBean.START: Failed to start service


14:00:30,424 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.deployment.subunit.\"server-ear.ear\".\"server-ejb-1.0.0-SNAPSHOT.jar\".component.TestJMS.START" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"server-ear.ear\".\"server-ejb-1.0.0-SNAPSHOT.jar\".component.TestJMS.START: Failed to start service","jboss.deployment.subunit.\"server-ear.ear\".\"server-ejb-1.0.0-SNAPSHOT.jar\".component.TccCacheBean.START" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"server-ear.ear\".\"server-ejb-1.0.0-SNAPSHOT.jar\".component.TccCacheBean.START: Failed to start service","jboss.deployment.subunit.\"server-ear.ear\".\"server-ejb-1.0.0-SNAPSHOT.jar\".component.RandomRawPriceImporterService.START" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"server-ear.ear\".\"server-ejb-1.0.0-SNAPSHOT.jar\".component.RandomRawPriceImporterService.START: Failed to start service"}}}}

 

Any ideas?

  • 1. Re: duplicate class definition for name: org/jboss/weldx/persistence/EntityManager
    Scott Marlow Master

    This sounds like a race condition caused by an attempt to load the same class twice.

     

    Maybe you can get more information by enabling TRACE logging and recreate the error, then look at the TRACE log output (as7/standalone/log/server.log) for clues as to which threads loaded the same class (org.jboss.weldx.persistence.EntityManager) and why.

     

     

    <subsystem xmlns="urn:jboss:domain:logging:1.1">
        <console-handler name="CONSOLE">
        <level name="TRACE"/>
        <formatter>
            <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
        </formatter>
        </console-handler>
        <periodic-rotating-file-handler name="FILE">
        <formatter>
            <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
        </formatter>
        <file relative-to="jboss.server.log.dir" path="server.log"/>
        <suffix value=".yyyy-MM-dd"/>
        <append value="true"/>
        </periodic-rotating-file-handler>
        <logger category="com.arjuna">
        <level name="WARN"/>
        </logger>
        <logger category="org.apache.tomcat.util.modeler">
        <level name="WARN"/>
        </logger>
        <logger category="sun.rmi">
        <level name="WARN"/>
        </logger>
        <logger category="jacorb">
        <level name="WARN"/>
        </logger>
        <logger category="jacorb.config">
        <level name="ERROR"/>
        </logger>
        <root-logger>
        <level name="TRACE"/>
        <handlers>
            <handler name="CONSOLE"/>
            <handler name="FILE"/>
        </handlers>
        </root-logger>
    </subsystem>
    

     

    You probably could get more selective than turning trace on for everything, but in this case, more information is better (assuming you will be searching for "org.jboss.weldx.persistence.EntityManager" via an editor search feature). 

     

    Scott

  • 2. Re: duplicate class definition for name: org/jboss/weldx/persistence/EntityManager
    Scott Marlow Master

    The above settings go in as7/standalone/configuration/standalone.xml.

  • 3. Re: duplicate class definition for name: org/jboss/weldx/persistence/EntityManager
    Tomaz Cerar Master

    What does you application layout looks like?

    can you post output of jar tf <name of your deplyoment>

    my first guess would be that you are bunding weld-core jar inside your app.

     

     

    --

    tomaz

  • 4. Re: duplicate class definition for name: org/jboss/weldx/persistence/EntityManager
    Michael Wittig Newbie

    Scott Marlow schrieb:

     

    This sounds like a race condition caused by an attempt to load the same class twice.

     

    Maybe you can get more information by enabling TRACE logging and recreate the error, then look at the TRACE log output (as7/standalone/log/server.log) for clues as to which threads loaded the same class (org.jboss.weldx.persistence.EntityManager) and why.

     

     

    You probably could get more selective than turning trace on for everything, but in this case, more information is better (assuming you will be searching for "org.jboss.weldx.persistence.EntityManager" via an editor search feature).

     

    Scott

     

     

     

    Hi. I attached my log file. As far as I understand the output there are no problems?

  • 5. Re: duplicate class definition for name: org/jboss/weldx/persistence/EntityManager
    Michael Wittig Newbie

    Tomaz Cerar schrieb:

     

    What does you application layout looks like?

    can you post output of jar tf <name of your deplyoment>

    my first guess would be that you are bunding weld-core jar inside your app.

     

     

    --

    tomaz

    My application is a a maven project based on the "Java EE Project" template in JBoss Central.

     

    jar tf server-ear.ear

     

    lib/json-external-1.0.0-SNAPSHOT.jar

    lib/json-internal-1.0.0-SNAPSHOT.jar

    lib/json-1.0.0-SNAPSHOT.jar

    lib/json-price-1.0.0-SNAPSHOT.jar

    lib/q-connector-1.0.0-SNAPSHOT.jar

    META-INF/MANIFEST.MF

    META-INF/application.xml

    META-INF/maven/com.company.test/server-ear/pom.properties

    META-INF/maven/com.company.test/server-ear/pom.xml

    lib/jackson-mapper-asl-1.9.2.jar

    lib/jackson-core-asl-1.9.2.jar

    lib/client-3.2.0-SNAPSHOT.jar

    lib/core-3.2.0-SNAPSHOT.jar

    lib/jsonrpc-1.0.0.jar

    lib/javassist-3.12.1.GA.jar

    lib/annotation-detector-3.0.0.jar

    lib/common-data-1.0.0-SNAPSHOT.jar

    lib/shared-1.0.0-SNAPSHOT.jar

    lib/commons-codec-1.6.jar

    lib/external-3.2.0-SNAPSHOT.jar

    lib/geronimo-spec-jms-1.1-rc4.jar

    lib/guava-11.0.2.jar

    lib/jsr305-1.3.9.jar

    server-ejb-1.0.0-SNAPSHOT.jar

    META-INF/

    META-INF/maven/

    META-INF/maven/com.company.test/

    META-INF/maven/com.company.test/server-ear/

    lib/

     

  • 6. Re: duplicate class definition for name: org/jboss/weldx/persistence/EntityManager
    Scott Marlow Master

    In the server.log, I see that different threads are looking for org.jboss.weldx.persistence.EntityManager and not finding.  The next question is, will they atomically define org.jboss.weldx.persistence.EntityManager or will multiple threads try to define it. 

     

    Note the thread names involved with looking for this class (will shorten to just the number part ignoring "msc service thread").  1-3, 1-2, 1-8, 1-1

     

     

    08:03:32,449 TRACE [org.jboss.weld.Bean] (MSC service thread 1-3) Retrieving/generating proxy class org.jboss.weldx.persistence.EntityManager$713319412$Proxy$_$$_Weld$Proxy$
    08:03:32,449 TRACE [org.jboss.modules] (MSC service thread 1-3) Finding class org.jboss.weldx.persistence.EntityManager$713319412$Proxy$_$$_Weld$Proxy$ from Module "deployment.server-ear.ear.server-ejb-1.0.0-SNAPSHOT.jar:main" from Service Module Loader
    08:03:32,449 TRACE [org.jboss.modules] (MSC service thread 1-3) Class org.jboss.weldx.persistence.EntityManager$713319412$Proxy$_$$_Weld$Proxy$ not found from Module "deployment.server-ear.ear.server-ejb-1.0.0-SNAPSHOT.jar:main" from Service Module Loader
    08:03:32,449 TRACE [org.jboss.modules] (MSC service thread 1-8) Defined class org.jboss.weld.bean.builtin.ee.EEResourceProducerField$EEResourceCallable in Module "org.jboss.weld.core:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,449 TRACE [org.hornetq.core.remoting.server.impl.RemotingServiceImpl] (default-short-running-threads-threads - 1) Connection created InVMConnection [serverID=0, id=4d1dbdbf-74b6-11e1-a7f6-beae20524153]
    08:03:32,449 TRACE [org.jboss.weld.Bean] (MSC service thread 1-8) Retrieving/generating proxy class org.jboss.weldx.persistence.EntityManager$713319412$Proxy$_$$_Weld$Proxy$
    08:03:32,449 TRACE [org.jboss.weld.Bean] (MSC service thread 1-3) Adding method public java.lang.String java.lang.Object.toString()
    08:03:32,449 TRACE [org.jboss.modules] (MSC service thread 1-4) Defined class org.jboss.as.weld.ejb.Jsr299BindingsInterceptor$1 in Module "org.jboss.as.weld:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,449 TRACE [org.jboss.modules] (MSC service thread 1-2) Defined class org.jboss.as.weld.ejb.Jsr299BindingsInterceptor$1 in Module "org.jboss.as.weld:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,449 TRACE [org.jboss.weld.Bean] (MSC service thread 1-1) Retrieving/generating proxy class org.jboss.weldx.persistence.EntityManager$713319412$Proxy$_$$_Weld$Proxy$
    08:03:32,449 TRACE [org.jboss.modules] (MSC service thread 1-7) Finding class org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler from Module "org.jboss.weld.core:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,465 TRACE [org.jboss.modules] (MSC service thread 1-1) Finding class org.jboss.weldx.persistence.EntityManager$713319412$Proxy$_$$_Weld$Proxy$ from Module "deployment.server-ear.ear.server-ejb-1.0.0-SNAPSHOT.jar:main" from Service Module Loader
    08:03:32,465 TRACE [org.jboss.modules] (MSC service thread 1-2) Finding class javax.transaction.Transaction from Module "org.jboss.as.ejb3:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,465 TRACE [org.jboss.modules] (MSC service thread 1-2) Finding local class javax.transaction.Transaction from Module "javax.transaction.api:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,449 TRACE [org.jboss.modules] (MSC service thread 1-4) Finding class javax.transaction.Transaction from Module "org.jboss.as.ejb3:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,465 TRACE [org.jboss.modules] (MSC service thread 1-4) Finding local class javax.transaction.Transaction from Module "javax.transaction.api:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,465 TRACE [org.jboss.modules] (MSC service thread 1-4) Found previously loaded interface javax.transaction.Transaction from Module "javax.transaction.api:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,449 TRACE [org.jboss.modules] (MSC service thread 1-3) Finding class javax.persistence.LockModeType from Module "javax.persistence.api:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,449 TRACE [org.jboss.modules] (MSC service thread 1-8) Finding class org.jboss.weldx.persistence.EntityManager$713319412$Proxy$_$$_Weld$Proxy$ from Module "deployment.server-ear.ear.server-ejb-1.0.0-SNAPSHOT.jar:main" from Service Module Loader
    08:03:32,449 TRACE [org.hornetq.core.protocol.core.impl.ChannelImpl] (default-short-running-threads-threads - 1) Sending packet nonblocking PACKET(Ping)[type=10, channelID=0, packetObject=Ping, connectionTTL=60000] on channeID=0
    08:03:32,465 TRACE [org.jboss.modules] (MSC service thread 1-8) Class org.jboss.weldx.persistence.EntityManager$713319412$Proxy$_$$_Weld$Proxy$ not found from Module "deployment.server-ear.ear.server-ejb-1.0.0-SNAPSHOT.jar:main" from Service Module Loader
    08:03:32,465 TRACE [org.jboss.modules] (MSC service thread 1-3) Finding local class javax.persistence.LockModeType from Module "javax.persistence.api:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,465 TRACE [org.jboss.modules] (MSC service thread 1-4) Finding class com.arjuna.ats.internal.jta.utils.arjunacore.StatusConverter from Module "org.jboss.jts:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,465 TRACE [org.jboss.modules] (MSC service thread 1-2) Found previously loaded interface javax.transaction.Transaction from Module "javax.transaction.api:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,465 TRACE [org.jboss.modules] (MSC service thread 1-1) Class org.jboss.weldx.persistence.EntityManager$713319412$Proxy$_$$_Weld$Proxy$ not found from Module "deployment.server-ear.ear.server-ejb-1.0.0-SNAPSHOT.jar:main" from Service Module Loader
    08:03:32,465 TRACE [org.jboss.modules] (MSC service thread 1-7) Finding local class org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler from Module "org.jboss.weld.core:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,465 TRACE [org.jboss.weld.Bean] (MSC service thread 1-1) Adding method public java.lang.String java.lang.Object.toString()
    
    

     

    Next, I see thread "MSC service thread 1-8" appears to have created org.jboss.weldx.persistence.EntityManager.  Meanwhile, thread "MSC service thread 1-7" reports also not finding org.jboss.weldx.persistence.EntityManager.

     

    08:03:32,730 TRACE [org.jboss.weld.Bean] (MSC service thread 1-8) Created Proxy class of type class org.jboss.weldx.persistence.EntityManager$713319412$Proxy$_$$_Weld$Proxy$ supporting interfaces [interface javax.persistence.EntityManager, interface java.io.Serializable, interface org.jboss.interceptor.proxy.LifecycleMixin, interface org.jboss.interceptor.util.proxy.TargetInstanceProxy, interface javassist.util.proxy.ProxyObject]
    08:03:32,715 TRACE [org.jboss.modules] (MSC service thread 1-7) Finding class org.jboss.weldx.persistence.EntityManager$713319412$Proxy$_$$_Weld$Proxy$ from Module "deployment.server-ear.ear.server-ejb-1.0.0-SNAPSHOT.jar:main" from Service Module Loader
    08:03:32,730 TRACE [org.jboss.modules] (MSC service thread 1-1) Finding class org.jboss.weld.exceptions.WeldExceptionStringMessage from Module "org.jboss.weld.core:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,730 TRACE [org.jboss.modules] (MSC service thread 1-1) Finding local class org.jboss.weld.exceptions.WeldExceptionStringMessage from Module "org.jboss.weld.core:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,730 TRACE [org.jboss.modules] (MSC service thread 1-1) Loading class org.jboss.weld.exceptions.WeldExceptionStringMessage locally from Module "org.jboss.weld.core:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,730 TRACE [org.jboss.modules] (MSC service thread 1-3) Finding class org.jboss.weld.exceptions.WeldExceptionStringMessage from Module "org.jboss.weld.core:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,730 TRACE [org.jboss.modules] (MSC service thread 1-3) Finding local class org.jboss.weld.exceptions.WeldExceptionStringMessage from Module "org.jboss.weld.core:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,730 TRACE [org.jboss.modules] (MSC service thread 1-3) Loading class org.jboss.weld.exceptions.WeldExceptionStringMessage locally from Module "org.jboss.weld.core:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,730 TRACE [org.jboss.modules] (default-short-running-threads-threads - 4) Attempting to define class org.hornetq.ra.inflow.HornetQMessageHandler in Module "org.hornetq.ra:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,730 TRACE [org.jboss.modules] (default-short-running-threads-threads - 3) Class org.jboss.threads.QueueExecutor$Worker not found from Module "org.jboss.logmanager:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,730 TRACE [org.hornetq.core.protocol.core.impl.ChannelImpl] (Thread-4 (HornetQ-remoting-threads-HornetQServerImpl::serverUUID=a61fe076-736a-11e1-b63d-ca5220524153-658762510-1543305285)) Writing buffer for channelID=10
    08:03:32,715 TRACE [org.hornetq.core.remoting.impl.invm.InVMConnection] (Thread-1 (HornetQ-client-global-threads-1625786878)) InVMConnection [serverID=0, id=4d3a6d83-74b6-11e1-a7f6-beae20524153]::packet sent done
    08:03:32,715 TRACE [org.jboss.modules] (default-short-running-threads-threads - 1) Attempting to define class org.hornetq.ra.inflow.HornetQMessageHandler in Module "org.hornetq.ra:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,730 TRACE [org.hornetq.core.remoting.impl.invm.InVMConnection] (Thread-1 (HornetQ-client-global-threads-1625786878)) InVMConnection [serverID=0, id=4d3a6d83-74b6-11e1-a7f6-beae20524153]::Sending inVM packet
    08:03:32,730 TRACE [org.hornetq.core.remoting.impl.invm.InVMConnection] (Thread-4 (HornetQ-remoting-threads-HornetQServerImpl::serverUUID=a61fe076-736a-11e1-b63d-ca5220524153-658762510-1543305285)) InVMConnection [serverID=0, id=4d3a6d83-74b6-11e1-a7f6-beae20524153]::packet sent done
    08:03:32,730 TRACE [org.jboss.modules] (default-short-running-threads-threads - 3) Finding class org.jboss.threads.JBossThread from Module "org.hornetq.ra:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,730 TRACE [org.jboss.modules] (default-short-running-threads-threads - 4) Finding class org.hornetq.api.core.client.MessageHandler from Module "org.hornetq.ra:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,730 TRACE [org.jboss.modules] (default-short-running-threads-threads - 4) Finding local class org.hornetq.api.core.client.MessageHandler from Module "org.hornetq:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,730 TRACE [org.jboss.modules] (MSC service thread 1-3) Attempting to define class org.jboss.weld.exceptions.WeldExceptionStringMessage in Module "org.jboss.weld.core:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,730 TRACE [org.jboss.modules] (MSC service thread 1-1) Attempting to define class org.jboss.weld.exceptions.WeldExceptionStringMessage in Module "org.jboss.weld.core:main" from local module loader @25b13009 (roots: C:\jboss-as-7.1.1.Final.test\modules)
    08:03:32,730 INFO  [stdout] (MSC service thread 1-8) Hello: TestJMS
    
    08:03:32,730 TRACE [org.jboss.modules] (MSC service thread 1-7) Class org.jboss.weldx.persistence.EntityManager$713319412$Proxy$_$$_Weld$Proxy$ not found from Module "deployment.server-ear.ear.server-ejb-1.0.0-SNAPSHOT.jar:main" from Service Module Loader
    08:03:32,730 INFO  [stdout] (MSC service thread 1-8) testQueue
    

     

     

    Then, I think thread "... 1-8" is proceeding forward.

     

    08:03:32,731 TRACE [org.jboss.weld.Bean] (MSC service thread 1-8) MethodHandler processing call to public abstract boolean javax.persistence.EntityManager.isOpen() for class org.jboss.weldx.persistence.EntityManager$713319412$Proxy$_$$_Weld$Proxy$
    
    

     

    Hmm, interesting that thread ".... 1-8" soon again doesn't see the generated class.  I'm not sure what this means yet.  Maybe something went wrong with defining this class before and it didn't really get defined or maybe it is defined on the wrong classloader (different than the one we are looking for the class on).

     

     

    08:03:32,465 TRACE [org.jboss.modules] (MSC service thread 1-8) Class org.jboss.weldx.persistence.EntityManager$713319412$Proxy$_$$_Weld$Proxy$ not found from Module "deployment.server-ear.ear.server-ejb-1.0.0-SNAPSHOT.jar:main" from Service Module Loader
    

     

    Jumping ahead to the actual duplicate cls def errors.  Of the threads previously thought to be looking for the class (1-3, 1-2, 1-8, 1-1).  The duplicate class definied error happened on three out of four of those threads.  This sounds like a race condition bug to me.

     

     

    08:03:32,809 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.deployment.subunit."server-ear.ear"."server-ejb-1.0.0-SNAPSHOT.jar".component.PricingService.START: org.jboss.msc.service.StartException in service jboss.deployment.subunit."server-ear.ear"."server-ejb-1.0.0-SNAPSHOT.jar".component.PricingService.START: Failed to start service
    Caused by: javax.ejb.EJBException: org.jboss.weld.exceptions.WeldException: by java.lang.LinkageError: loader (instance of  org/jboss/modules/ModuleClassLoader): attempted  duplicate class definition for name: "org/jboss/weldx/persistence/EntityManager$713319412$Proxy$_$$_Weld$Proxy$"
    ...
    
    08:03:33,043 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.deployment.subunit."server-ear.ear"."server-ejb-1.0.0-SNAPSHOT.jar".component.RandomRawPriceImporterService.START: org.jboss.msc.service.StartException in service jboss.deployment.subunit."server-ear.ear"."server-ejb-1.0.0-SNAPSHOT.jar".component.RandomRawPriceImporterService.START: Failed to start service
    ...
    
    08:03:32,809 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.subunit."server-ear.ear"."server-ejb-1.0.0-SNAPSHOT.jar".component.TccCacheBean.START: org.jboss.msc.service.StartException in service jboss.deployment.subunit."server-ear.ear"."server-ejb-1.0.0-SNAPSHOT.jar".component.TccCacheBean.START: Failed to start service
    
    

     

    What do others think? 

     

    Scott

  • 7. Re: duplicate class definition for name: org/jboss/weldx/persistence/EntityManager
    Tomaz Cerar Master

    Hi,

     

    can you remove geronimo-spec-jms-1.1-rc4.jar and javassist-3.12.1.GA.jar from your lib.

     

    jms spec is added automaticly as dependancy and there is no need to add it yourself.

    for javassist if there is real need in your application for it, then i would recomend you importing it via dependancies in MANIFEST.MF or jboss-deployment-structure.xml

     

    as javaassit inside your app could produce errors like this, as classes are javaassit enhanced on server and then used in application.

     

     

    --

    tomaz

  • 8. Re: duplicate class definition for name: org/jboss/weldx/persistence/EntityManager
    Michael Wittig Newbie

    I jumped further into the problem and found out, that the problem occurs when I try to deploy more than one @Startup @Singleton Bean with an Injected EntityManager.

  • 9. Re: duplicate class definition for name: org/jboss/weldx/persistence/EntityManager
    Michael Wittig Newbie

    Tomaz Cerar schrieb:

     

    Hi,

     

    can you remove geronimo-spec-jms-1.1-rc4.jar and javassist-3.12.1.GA.jar from your lib.

     

    jms spec is added automaticly as dependancy and there is no need to add it yourself.

    for javassist if there is real need in your application for it, then i would recomend you importing it via dependancies in MANIFEST.MF or jboss-deployment-structure.xml

     

    as javaassit inside your app could produce errors like this, as classes are javaassit enhanced on server and then used in application.

     

     

    --

    tomaz

    The two libraries are dependencies of some other projects. So I will figure out how " importing it via dependancies" works...

     

    EDIT: Removed the libs. Problem still exists.

  • 10. Re: duplicate class definition for name: org/jboss/weldx/persistence/EntityManager
    Tomaz Cerar Master

    Hi,

    Can you update weld to 1.1.6.Final (released this week)

    or just use nightly build of as7.1.2 (weld update was included yesterday)

     

    as this seems to be an issue in weld.

     

    --

    tomaz

  • 11. Re: duplicate class definition for name: org/jboss/weldx/persistence/EntityManager
    Michael Wittig Newbie

    Weld 1.1.6.Final doesnt seem to work. https://community.jboss.org/message/726213#726213 also have the Weld problem.

    Nightlybuild as far as https://ci.jboss.org/jenkins/job/JBoss-AS-7.x-latest/ is the korrekt location seem to be pretty old.

  • 12. Re: duplicate class definition for name: org/jboss/weldx/persistence/EntityManager
    Aleš Bregar Newbie

    Hi,

     

    my 50cents as I have the same problem occurrence. I have tried to build latest as7 from today (27th March) to include weld 1.1.6.Final (I can report too that Jenkins is stil on strike).

     

    Test case is like this:

     

    - I have abstract web filter in ejb jar which injects some JPA based repositories

    - some different parts of (web)app create an impl of this filter with various @WebFilter annotation parameters

    - jboss is freshly started, and in 1 out of 5 cases, when some servlet is hit via this filter I got The error

    - seems that only first one hit has a problem, all the next are ok

     

    I got the above error even with weld 1.1.6, stack trace included if of any help.

  • 13. Re: duplicate class definition for name: org/jboss/weldx/persistence/EntityManager
    Ales Justin Master

    This is a race-condition in AS7, which Stuart already fixed, afaik.

  • 14. Re: duplicate class definition for name: org/jboss/weldx/persistence/EntityManager
    Jay Balunas Master

    It sounds like this issue was already fixed and is actually an AS issue.  Not sure why the issue was opened in AEROGEAR jira.  I'm going to reject it, but please feel free to reopen and move to the appropirate project.

1 2 Previous Next