4 Replies Latest reply: Aug 1, 2012 4:20 AM by Dave Fr RSS

CDI: WeldService Error if use EAR instead standalone WAR

Dave Fr Newbie

Hi,

 

since the last update of the 2.1.0-SNAPSHOT I get errors if I try to deploy my GWT/Errai projects inside an EAR to JBoss 7.1.1.Final. With previous versions (i.e a week before) there was no problem using EARs.

 

I use the archetype from https://docs.jboss.org/author/display/ERRAI/Errai+CDI+Maven+Archetype to create a project. The resulting WAR is running without any problems:

 

WAR Standalone:

---------------

17:11:23,725 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found ErraiCDI.war in deployment directory. To trigger deployment create a file called ErraiCDI.war.dodeploy
17:11:23,730 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "ErraiCDI.war"
17:11:24,103 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-4) JBAS018567: Deployment "deployment.ErraiCDI.war" is using a private module ("org.jboss.as.naming:main") which may be changed or removed in future versions without notice.
17:11:24,103 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-4) JBAS018567: Deployment "deployment.ErraiCDI.war" is using a private module ("org.jboss.as.naming:main") which may be changed or removed in future versions without notice.
17:11:24,104 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-4) JBAS018567: Deployment "deployment.ErraiCDI.war" is using a private module ("org.jboss.as.server:main") which may be changed or removed in future versions without notice.
17:11:24,104 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-4) JBAS018567: Deployment "deployment.ErraiCDI.war" is using a private module ("org.jboss.as.server:main") which may be changed or removed in future versions without notice.
17:11:24,132 INFO  [org.jboss.weld.deployer] (MSC service thread 1-7) JBAS016002: Processing weld deployment ErraiCDI.war
17:11:24,183 INFO  [org.jboss.weld.deployer] (MSC service thread 1-5) JBAS016005: Starting Services for CDI deployment: ErraiCDI.war
17:11:24,191 INFO  [org.jboss.weld.deployer] (MSC service thread 1-8) JBAS016008: Starting weld service for deployment ErraiCDI.war
17:11:24,201 INFO  [org.jboss.errai.cdi.server.CDIExtensionPoints] (MSC service thread 1-8) starting errai cdi ...
17:11:24,305 INFO  [org.jboss.errai.cdi.server.CDIExtensionPoints] (pool-16-thread-1) all services registered successfully
17:11:24,970 INFO  [org.jboss.errai.reflections.Reflections] (Thread-75) Reflections took 553 ms to scan 6 urls, producing 268 keys and 928 values 
17:11:25,254 INFO  [org.jboss.errai.reflections.Reflections] (Thread-75) Reflections took 283 ms to scan 6 urls, producing 268 keys and 928 values 
17:11:25,439 INFO  [org.jboss.errai.bus.server.service.bootstrap.OrderedBootstrap] (MSC service thread 1-6) starting errai bus ...
17:11:25,442 INFO  [org.jboss.errai.bus.server.service.bootstrap.DefaultComponents] (MSC service thread 1-6) authentication adapter configured: org.jboss.errai.bus.server.security.auth.JAASAdapter
17:11:25,449 INFO  [org.jboss.errai.bus.server.service.bootstrap.DefaultComponents] (MSC service thread 1-6) using dispatcher implementation: org.jboss.errai.bus.server.SimpleDispatcher
17:11:25,454 INFO  [org.jboss.errai.bus.server.service.bootstrap.DefaultComponents] (MSC service thread 1-6) using session provider implementation: org.jboss.errai.bus.server.HttpSessionProvider
17:11:25,464 INFO  [org.jboss.errai.bus.server.service.bootstrap.LoadExtensions] (MSC service thread 1-6) searching for errai extensions ...
17:11:25,476 INFO  [org.jboss.errai.bus.server.service.bootstrap.OrderedBootstrap] (MSC service thread 1-6) errai bus started.
17:11:25,479 INFO  [org.jboss.web] (MSC service thread 1-6) JBAS018210: Registering web context: /ErraiCDI
17:11:25,594 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "ErraiCDI.war"

 

In the other case I use an EAR to put all the WARs and JARs in it. If I try to deploy the EAR with only one WAR (see above) inside the EAR and I get the following errors:

 

17:07:52,827 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found ErraiCDI_EAR-ear.ear in deployment directory. To trigger deployment create a file called ErraiCDI_EAR-ear.ear.dodeploy
17:07:52,832 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "ErraiCDI_EAR-ear.ear"
17:07:52,836 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "ErraiCDI-1.0.war"
17:07:53,153 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015850: /opt/jboss-as-7.1.1.Final/standalone/deployments/ErraiCDI_EAR-ear.ear/ErraiCDI-1.0.war/WEB-INF/jboss-deployment-structure.xml in subdeployment ignored. jboss-deployment-structure.xml is only parsed for top level deployments.
17:07:53,185 INFO  [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016002: Processing weld deployment ErraiCDI_EAR-ear.ear
17:07:53,220 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016002: Processing weld deployment ErraiCDI-1.0.war
17:07:53,227 INFO  [org.jboss.weld.deployer] (MSC service thread 1-5) JBAS016005: Starting Services for CDI deployment: ErraiCDI_EAR-ear.ear
17:07:53,233 INFO  [org.jboss.weld.deployer] (MSC service thread 1-6) JBAS016008: Starting weld service for deployment ErraiCDI_EAR-ear.ear
17:07:53,234 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-8) JBAS010400: Bound data source [jboss/datasources/ErraiCDI_EARDS]
17:07:53,248 INFO  [org.jboss.errai.cdi.server.CDIExtensionPoints] (MSC service thread 1-6) starting errai cdi ...
17:07:53,344 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC00001: Failed to start service jboss.deployment.unit."ErraiCDI_EAR-ear.ear".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."ErraiCDI_EAR-ear.ear".WeldService: org.jboss.weld.exceptions.DefinitionException: Exception List with 1 exceptions:
Exception 0 :
java.lang.RuntimeException: Could not load class: org.errai.cdi.client.shared.HelloMessage
    at org.jboss.errai.codegen.meta.MetaClassFactory.loadClass(MetaClassFactory.java:459)
    at org.jboss.errai.codegen.meta.MetaClassFactory.createOrGet(MetaClassFactory.java:221)
    at org.jboss.errai.codegen.meta.MetaClassFactory.get(MetaClassFactory.java:129)
    at org.jboss.errai.config.rebind.EnvUtil.isPortableType(EnvUtil.java:236)
    at org.jboss.errai.cdi.server.CDIExtensionPoints.processObserverMethod(CDIExtensionPoints.java:319)
    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.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264)
    at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
    at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)
    at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260)
    at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:170)
    at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:51)
    at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:154)
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:241)
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:229)
    at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:207)
    at org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:569)
    at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:559)
    at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:60)
    at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:38)
    at org.jboss.weld.bootstrap.events.ProcessObserverMethodImpl.fire(ProcessObserverMethodImpl.java:41)
    at org.jboss.weld.bootstrap.AbstractBeanDeployer.deploy(AbstractBeanDeployer.java:144)
    at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:204)
    at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:344)
    at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:82)
    at org.jboss.as.weld.services.WeldService.start(WeldService.java:76)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)

    at org.jboss.as.weld.services.WeldService.start(WeldService.java:83)
    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]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_05]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_05]
    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_05]
Caused by: org.jboss.weld.exceptions.DefinitionException: Exception List with 1 exceptions:
Exception 0 :
java.lang.RuntimeException: Could not load class: org.errai.cdi.client.shared.HelloMessage
    at org.jboss.errai.codegen.meta.MetaClassFactory.loadClass(MetaClassFactory.java:459)
    at org.jboss.errai.codegen.meta.MetaClassFactory.createOrGet(MetaClassFactory.java:221)
    at org.jboss.errai.codegen.meta.MetaClassFactory.get(MetaClassFactory.java:129)
    at org.jboss.errai.config.rebind.EnvUtil.isPortableType(EnvUtil.java:236)
    at org.jboss.errai.cdi.server.CDIExtensionPoints.processObserverMethod(CDIExtensionPoints.java:319)
    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.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264)
    at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
    at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)
    at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260)
    at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:170)
    at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:51)
    at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:154)
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:241)
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:229)
    at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:207)
    at org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:569)
    at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:559)
    at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:60)
    at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:38)
    at org.jboss.weld.bootstrap.events.ProcessObserverMethodImpl.fire(ProcessObserverMethodImpl.java:41)
    at org.jboss.weld.bootstrap.AbstractBeanDeployer.deploy(AbstractBeanDeployer.java:144)
    at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:204)
    at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:344)
    at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:82)
    at org.jboss.as.weld.services.WeldService.start(WeldService.java:76)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)

    at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:40)
    at org.jboss.weld.bootstrap.events.ProcessObserverMethodImpl.fire(ProcessObserverMethodImpl.java:41)
    at org.jboss.weld.bootstrap.AbstractBeanDeployer.deploy(AbstractBeanDeployer.java:144)
    at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:204)
    at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:344)
    at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:82)
    at org.jboss.as.weld.services.WeldService.start(WeldService.java:76)
    ... 5 more

17:07:53,563 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "ErraiCDI_EAR-ear.ear" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"ErraiCDI_EAR-ear.ear\".WeldService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"ErraiCDI_EAR-ear.ear\".WeldService: org.jboss.weld.exceptions.DefinitionException: Exception List with 1 exceptions:
Exception 0 :
java.lang.RuntimeException: Could not load class: org.errai.cdi.client.shared.HelloMessage
    at org.jboss.errai.codegen.meta.MetaClassFactory.loadClass(MetaClassFactory.java:459)
    at org.jboss.errai.codegen.meta.MetaClassFactory.createOrGet(MetaClassFactory.java:221)
    at org.jboss.errai.codegen.meta.MetaClassFactory.get(MetaClassFactory.java:129)
    at org.jboss.errai.config.rebind.EnvUtil.isPortableType(EnvUtil.java:236)
    at org.jboss.errai.cdi.server.CDIExtensionPoints.processObserverMethod(CDIExtensionPoints.java:319)
    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.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264)
    at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
    at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)
    at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260)
    at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:170)
    at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:51)
    at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:154)
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:241)
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:229)
    at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:207)
    at org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:569)
    at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:559)
    at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:60)
    at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:38)
    at org.jboss.weld.bootstrap.events.ProcessObserverMethodImpl.fire(ProcessObserverMethodImpl.java:41)
    at org.jboss.weld.bootstrap.AbstractBeanDeployer.deploy(AbstractBeanDeployer.java:144)
    at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:204)
    at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:344)
    at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:82)
    at org.jboss.as.weld.services.WeldService.start(WeldService.java:76)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
"}}

....

 

It seems to be a new issue. It would be nice to get a hint how to solve this.