0 Replies Latest reply on Dec 20, 2012 7:07 AM by nagendra peddu

    Getting NullPoint Exception when i used UserTransaction.

    nagendra peddu Newbie

      Hi I am using EntityManager with JTA Transaction when i used UserTransaction getting Nullpoint Exception...

       

       

      @Name("sample")

      @Scope(ScopeType.CONVERSATION)

      public class SampleHome extends EntityHome<Sample> implements Serializable {

       

         @Resource

          UserTransaction userTx;

        

           @In

           EntityManager entityManager;

       

         @Begin(join = true)

          public void create() {

          }

       

         @Begin(join=true)

         public void userTransaction(){

        

                     userTx.setTransactionTimeout(10 * 60); //getting null point exception

                 

                     userTx.begin();//getting null point exception

                 

                     getEntityManager().joinTransaction();

                      ///coding

                      getEntityManager().persist(temp);

                  

                      getEntityManager().flush();

         }

       

      component.xml

       

        <core:init debug="false" jndi-pattern="@jndiPattern@"/>

          <core:manager concurrent-request-timeout="2000"

              conversation-id-parameter="cid" conversation-timeout="120000"

              parent-conversation-id-parameter="pid" />

         

          <web:hot-deploy-filter url-pattern="/*.mobee" />

         

          <persistence:entity-manager-factory

              installed="@seamBootstrapsPu@" name="entityManagerFactory"

              persistence-unit-name="mobeeadmin" />

          <persistence:managed-persistence-context

              auto-create="true" entity-manager-factory="@seamEmfRef@" name="entityManager"

              persistence-unit-jndi-name="@puJndiName@" />

         

       

              <async:quartz-dispatcher />

         

         

          <security:identity authenticate-method="#{authenticator.authenticate}" />

       

         

          <web:rewrite-filter view-mapping="*.mobee" />

         

          <web:multipart-filter create-temp-files="true" max-request-size="28672000" url-pattern="*.seam"/>

          <event type="org.jboss.seam.security.notLoggedIn">

              <action execute="#{redirect.captureCurrentView}" />

          </event>

       

          <event type="org.jboss.seam.security.loginSuccessful">

              <action execute="#{redirect.returnToCapturedView}" />

          </event>

          <mail:mail-session host="localhost" port="25" />