[jboss-user] [JBoss Portal] - Problem while retrieving user details from db

PVApparao do-not-reply at jboss.com
Thu Aug 2 09:04:52 EDT 2007


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.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4070096#4070096

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4070096



More information about the jboss-user mailing list