1 Reply Latest reply on May 8, 2008 9:30 AM by freesoul

    Unable to locate current JTA transaction?

    freesoul

      when call the portal mbean

      UserModule mbean = (UserModule) MBeanProxyExt
       .create(UserModule.class, ObjectNameFactory
       .create("portal:service=Module,type=User"));
       mbean.getUserCount();

      the application throws exception as follows,
      20:36:21,875 ERROR [HibernateUserModuleImpl] Cannot count users
      org.hibernate.HibernateException: Unable to locate current JTA transaction
       at org.hibernate.context.JTASessionContext.currentSession(JTASessionContext.java:61)
       at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:544)
       at org.jboss.portal.identity.db.HibernateUserModuleImpl.getCurrentSession(HibernateUserModuleImpl.java:298)
       at org.jboss.portal.identity.db.HibernateUserModuleImpl.getUserCount(HibernateUserModuleImpl.java:275)


      I search some same problems on the forum but no good answers,
      some one said we should put such config to jboss-porlet.xml
      <transaction>
       <trans-attribute>Required</trans-attribute>
       </transaction>


      but i didn't call it in a portlet so it didn't work.
      Anyone can explain the reason of 'Unable to locate current JTA '??

      thanks.