1 2 Previous Next 19 Replies Latest reply on Jan 10, 2012 3:00 AM by mihaisheng Go to original post
      • 15. Re: Seam Managed persistence Context Problem
        mihaisheng
        Jason Porter:help me !

        i have the same problem:
        ----------------
        ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."testprog.war".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."testprog.war".WeldService: org.jboss.weld.exceptions.DefinitionException: WELD-001502 Resource producer field [Resource Producer Field [EntityManagerFactory] with qualifiers [@Any @Default] declared as [[field] @ConversationScoped @ExtensionManaged @Produces @PersistenceUnit EntityManagerProducer.emf]] 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)
             at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
             at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [:1.6.0_30]
             at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [:1.6.0_30]
             at java.lang.Thread.run(Unknown Source) [:1.6.0_30]
        Caused by: org.jboss.weld.exceptions.DefinitionException: WELD-001502 Resource producer field [Resource Producer Field [EntityManagerFactory] with qualifiers [@Any @Default] declared as [[field] @ConversationScoped @ExtensionManaged @Produces @PersistenceUnit EntityManagerProducer.emf]] 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
        ---------------
        the pom.xml is :
        ---------------
        <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
          <modelVersion>4.0.0</modelVersion>
          <groupId>mydept</groupId>
          <artifactId>testprog</artifactId>
          <packaging>war</packaging>
          <version>0.0.1-SNAPSHOT</version>
          <name>testprog Maven Webapp</name>
          <url>http://maven.apache.org</url>
          <dependencies>
            <dependency>
              <groupId>junit</groupId>
              <artifactId>junit</artifactId>
              <version>3.8.1</version>
              <scope>test</scope>
            </dependency>
            <!-- cdi -->

           
            <!-- seam -->
               <dependency>
              <groupId>org.jboss.seam.persistence</groupId>
              <artifactId>seam-persistence</artifactId>
              <version>3.1.0.Final</version>
            </dependency>

            <dependency>
              <groupId>org.jboss.seam.solder</groupId>
              <artifactId>seam-solder</artifactId>
              <version>3.1.0.Beta2</version>
            </dependency>
         
            <!-- end seam -->
             <dependency>
              <groupId>org.jboss.seam.remoting</groupId>
              <artifactId>seam-remoting</artifactId>
              <version>3.0.0.Final</version>
            </dependency>
           

            <dependency>
              <groupId>javax.enterprise</groupId>
              <artifactId>cdi-api</artifactId>
              <version>1.0-SP4</version>
            </dependency>
            <dependency>
              <groupId>org.jboss.seam.conversation</groupId>
              <artifactId>seam-conversation-weld</artifactId>
              <version>3.0.0.CR2</version>
            </dependency>
            <!--
            <dependency>
               <groupId>org.jboss.weld</groupId>
               <artifactId>weld-core</artifactId>
               <version>1.1.4.Final</version>
            </dependency>
             -->
            <!-- weld se -->
            <!--
            <dependency>
                  <groupId>org.jboss.weld.se</groupId>
              <artifactId>weld-se</artifactId>
              <version>1.1.4.Final</version>
             </dependency>
            <dependency>
             <groupId>org.jboss.weld.se</groupId>
               <artifactId>weld-se-core</artifactId>
               <version>1.1.4.Final</version>
            </dependency>

             -->
            <!-- end weld se -->
           
            <!-- hibernate -->
            <dependency>
               <groupId>org.hibernate</groupId>
               <artifactId>hibernate-core</artifactId>
               <version>4.0.0.CR7</version>
            </dependency>
            <dependency>
             <groupId>org.hibernate</groupId>
               <artifactId>hibernate-entitymanager</artifactId>
               <version>4.0.0.CR7</version>
            </dependency>
            <dependency>
               <groupId>org.hibernate</groupId>
               <artifactId>hibernate-commons-annotations</artifactId>
               <version>3.3.0.ga</version>
            </dependency>
            <dependency>
               <groupId>commons-collections</groupId>
               <artifactId>commons-collections</artifactId>
               <version>3.2.1</version>
            </dependency>
                   
            <dependency>
               <groupId>org.hibernate.javax.persistence</groupId>
               <artifactId>hibernate-jpa-2.0-api</artifactId>
               <version>1.0.0.Final</version>
            </dependency>
            <dependency>
               <groupId>javax.transaction</groupId>
               <artifactId>jta</artifactId>
               <version>1.1</version>
            </dependency>
        ...
        --------------------

        what can i do?

        • 16. Re: Seam Managed persistence Context Problem
          lightguard

          Make sure you're using all the same version of the seam modules: 3.1.0.Final (except Seam conversation which is at 3.0.0.Final). You also don't need to include weld. Hibernate, hibernate-entitymanager, jta, and cdi-api need to be <scope>provided</scope>.

          • 17. Re: Seam Managed persistence Context Problem
            mihaisheng

            Jason Porter:
            you said You also don't need to include weld. Hibernate, hibernate-entitymanager, jta.
            is AS7 include these jars???

            • 18. Re: Seam Managed persistence Context Problem
              blabno

              mi haisheng, come on! Is it so hard to search jboss-as directory for those jars?
              Community is happy to help but will not take you by the hand and walk through everything. Please, before you ask a question, think if you can find answer yourself.

              • 19. Re: Seam Managed persistence Context Problem
                mihaisheng
                thanks
                Jason Porter:
                i got the reson.
                  with seam3.1.0 modules,there is no [seam-solder],its change to below:
                --------
                    <dependency>
                         <groupId>org.jboss.solder</groupId>
                          <artifactId>solder-impl</artifactId>
                          <version>3.1.0.Final</version>
                    </dependency>
                --------
                so i try this pom.xml:
                --------
                    <dependency>
                         <groupId>org.jboss.solder</groupId>
                     <artifactId>solder-impl</artifactId>
                     <version>3.1.0.Final</version>
                    </dependency>
                    <dependency>
                      <groupId>org.jboss.seam.persistence</groupId>
                      <artifactId>seam-persistence</artifactId>
                      <version>3.1.0.Final</version>  <!--3.1.0.Final -->
                    </dependency>
                    <dependency>
                      <groupId>org.jboss.seam.transaction</groupId>
                      <artifactId>seam-transaction</artifactId>
                      <version>3.1.0.Final</version>
                    </dependency>
                ---------
                there is no error 
                1 2 Previous Next