2 Replies Latest reply on Sep 12, 2011 10:32 PM by Jason Porter

    Faces: troubles in setting up Seam-managed transactions

    Juergen Zimmermann Master
      I'm using JBoss 7 Jenkins build 1605. My EAR has an EJB module and 2 web modules (one for REST, one for Weld/Mojarra/Seam). The following config class in the 2nd web module causes the stacktrace below. Any hint is appreciated.

      public class SeamConfig {
              @Produces
              @ConversationScoped
              @PersistenceContext
              @SuppressWarnings("unused")
              private EntityManager em;
      }

      Stacktrace:
      11:13:44,331 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC00001: Failed to start service jboss.deployment.unit."swe.ear".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."swe.ear".WeldService: org.jboss.weld.exceptions.DefinitionException: WELD-001502 Resource producer field [Resource Producer Field [EntityManager] with qualifiers [@Any @Default] declared as [[field] @PersistenceContext @ConversationScoped @Produces private de.swe.util.SeamConfig.em]] must be @Dependent scoped
              at org.jboss.as.weld.services.WeldService.start(WeldService.java:96)
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [:1.7.0]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.7.0]
              at java.lang.Thread.run(Thread.java:722) [:1.7.0]
      Caused by: org.jboss.weld.exceptions.DefinitionException: WELD-001502 Resource producer field [Resource Producer Field [EntityManager] with qualifiers [@Any @Default] declared as [[field] @PersistenceContext @ConversationScoped @Produces private de.swe.util.SeamConfig.em]] must be @Dependent scoped
              at org.jboss.weld.bean.builtin.ee.EEResourceProducerField.checkEEResource(EEResourceProducerField.java:133)
              at org.jboss.weld.bean.builtin.ee.EEResourceProducerField.initialize(EEResourceProducerField.java:125)
              at org.jboss.weld.bootstrap.AbstractBeanDeployer.deploy(AbstractBeanDeployer.java:119)
              at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:227)
              at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:378)
              at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:81)
              at org.jboss.as.weld.services.WeldService.start(WeldService.java:89)
              ... 5 more