1 Reply Latest reply on Apr 27, 2009 7:52 AM by Nico Ziegenhals

    UserModule: hibernate problem

    Christelle Heritier Newbie

      Hi,

      I would like to use UserModule into a portlet that allow administrator to create new user.

      In my portlet I have tested this:
      UserModule userModule = (UserModule)getPortletContext().getAttribute("UserModule");
      User user = userModule.createUser('toto','toto','toto@test.com');

      In descriptor jboss-portlet I have put:

      <portlet>
       <portlet-name>UserAdminPortlet</portlet-name>
       <transaction>
       <trans-attribute>Required</trans-attribute>
       <transaction>
      <portlet>
      <service>
       <service-name>UserModule</service-name>
       <service-class>org.jboss.portal.identity.UserModule</service-class>
       <service-ref>:service=Module,type=User</service-ref>
       </service>
      

      I have this error:
      ERROR [UserModuleImpl] Cannot create user toto
      org.hibernate.HibernateException: Unable to locate current JTA transaction

      Can somebody tell me if I miss something or if I do something wrong?

      Thanks