User development,
A new message was posted in the thread "User not found with UserModule":
http://community.jboss.org/message/522985#522985
Author : Holger Breuer
Profile :
http://community.jboss.org/people/Gamba
Message:
--------------------------------------------------------------
Hi,
I want to read the current users email adress out of the UserProfileModule.
I placed the following code in a portlet, o jsf-managed-bean and an ejb with
transaction-attribute required:
try {
UserModule userModule = (UserModule) new
InitialContext().lookup("java:portal/UserModule");
User user = userModule.findUserByUserName(this.getCurrentUser());
System.out.println("USER = " +user.getUserName());
System.out.println("USER = " +user.toString());
UserProfileModule userProfile = (UserProfileModule) new
InitialContext().lookup("java:portal/UserProfileModule");
String email = (String) userProfile.getProperty(user,
User.INFO_USER_EMAIL_REAL);
System.out.println("EMAIL = " +email);
}
catch (NamingException ne) {
ne.printStackTrace();
}
catch (IdentityException ie) {
ie.printStackTrace();
}
In everey situation I get the following error:
14:34:20,468 ERROR [JDBCExceptionReporter] Could not enlist in transaction on entering
meta-aware object!; - nested throwable: (javax.transaction.SystemException:
java.lang.Throwable: Unabled to enlist resource, see the previous warnings.
tx=TransactionImple < ac, BasicAction: a1135a1:6b7:4b62e241:905 status:
ActionStatus.ABORT_ONLY >); - nested throwable:
(org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering
meta-aware object!; - nested throwable: (javax.transaction.SystemException:
java.lang.Throwable: Unabled to enlist resource, see the previous warnings.
tx=TransactionImple < ac, BasicAction: a1135a1:6b7:4b62e241:905 status:
ActionStatus.ABORT_ONLY >))
14:34:20,468 ERROR [HibernateUserModuleImpl] Cannot find user by name admin
org.hibernate.exception.GenericJDBCException: Cannot open connection
at
org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:426)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
at org.hibernate.loader.Loader.doQuery(Loader.java:673)
at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2220)
It seems that something with the transaction is not ok .....
Thx,
Holger
--------------------------------------------------------------
To reply to this message visit the message page:
http://community.jboss.org/message/522985#522985