1 Reply Latest reply on Aug 6, 2007 3:46 PM by krish p

    Problem while retrieving user details from db

    Venkata Apparao Newbie

      Hi I am using the following code to retrive the userdetails from db to display the edit profile page


      if (user == null) {
      throw new PortletException("Not user object found");
      } else {
      String userid = user.getId().toString();
      logger.info("*************** after getting userId ");
      logger.info("UserId is ------------------>" + userid);


      if (userid != null) {
      try {
      logger.info("User Id is not null **********");
      user = userModule.findUserById(userid);
      } catch (Exception e) {
      logger.error("Cannot retrive user", e);
      }
      }




      At the above statement it is generating the following exception



      17:15:59,140 INFO [UserProfilePortlet] *************** after getting userId
      17:15:59,140 INFO [UserProfilePortlet] UserId is ------------------>3
      17:15:59,140 INFO [UserProfilePortlet] User Id is not null **********
      17:15:59,156 ERROR [HibernateUserModuleImpl] Cannot find user by id 3
      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:542)
      at org.jboss.portal.identity.db.HibernateUserModuleImpl.getCurrentSession(HibernateUserModuleImpl.java:299)
      at org.jboss.portal.identity.db.HibernateUserModuleImpl.findUserById(HibernateUserModuleImpl.java:137)
      at org.jboss.portal.identity.db.HibernateUserModuleImpl.findUserById(HibernateUserModuleImpl.java:123)



      I have seen a post telling to set

      <trans-attribute> Required </trans-attribute> in jboss-portlet.xml.

      I did that and tried, still i am getting the same exception.


      Any one has idea about this exception

      I am using jboss-portal2.6.1 and jboss-4.0.5 as my appserver.