0 Replies Latest reply on Feb 8, 2013 8:01 AM by Rahul Razdan

    seam-persistence API ??

    Rahul Razdan Newbie

      hi,

       

      as per the documentation , a producer of entity manager can be created like this

       

      class Test{

       

                @Produces

                @PersistenceUnit

                @ExtensionManaged

                @ConversationScoped

          private EntityManagerFactory entityManager;

      }

       

      for this dependecy i added in POM

       

      <dependency>

                                    <groupId>org.jboss.solder</groupId>

                                    <artifactId>solder-impl</artifactId>

                                    <version>3.1.0.Final</version>

                                    <scope>provided</scope>

                          </dependency>

                          <dependency>

                                    <groupId>org.jboss.seam.persistence</groupId>

                                    <artifactId>seam-persistence</artifactId>

                                    <version>3.1.0.FINAL</version>

                          </dependency>

       

                          <dependency>

            <groupId>javax.enterprise</groupId>

            <artifactId>cdi-api</artifactId>

            <scope>provided</scope>

          </dependency>

          <dependency>

            <groupId>org.jboss.seam.conversation</groupId>

            <artifactId>seam-conversation-weld</artifactId>

            <version>3.0.0.Final</version>

          </dependency>

        

          <!-- hibernate -->

          <dependency>

             <groupId>org.hibernate</groupId>

             <artifactId>hibernate-core</artifactId>

             <scope>provided</scope>

          </dependency>

          <dependency>

           <groupId>org.hibernate</groupId>

             <artifactId>hibernate-entitymanager</artifactId>

             <scope>provided</scope>

          </dependency>

          <dependency>

             <groupId>org.hibernate</groupId>

             <artifactId>hibernate-commons-annotations</artifactId>

             <version>3.3.0.ga</version>

             <scope>provided</scope>

          </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>

             <scope>provided</scope>

          </dependency>

          <dependency>

             <groupId>javax.transaction</groupId>

             <artifactId>jta</artifactId>

             <version>1.1</version>

             <scope>provided</scope>

          </dependency>

       

                          <dependency>

                                    <groupId>org.jboss.seam</groupId>

                                    <artifactId>seam-bom</artifactId>

                                    <version>3.1.0.Final</version>

                                    <scope>import</scope>

                                    <type>pom</type>

                          </dependency>

       

       

                          <dependency>

                                    <groupId>javax.faces</groupId>

                                    <artifactId>jsf-api</artifactId>

                                    <version>2.1</version>

                                    <scope>provided</scope>

                          </dependency>

       

       

      beans.xml

       

      <?xml version="1.0"?>

      <beans xmlns="http://java.sun.com/xml/ns/javaee"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">

        <interceptors>

            <class>org.jboss.seam.transaction.TransactionInterceptor</class>

         </interceptors>

      </beans>

       

      and then i injected entity Manger normaly

       

      while running on jboss-as 7.1.1.Final i got

       

      org.jboss.seam.persistence.HibernatePersistenceProvider cannot be cast to org.jboss.seam.persistence.SeamPersistenceProvider

       

      gone through many links on this forum and on google but couldn't make it work .

       

      please any suggestion , anything will be helpfull

       

      Thanks