I need to access the UserModule and RoleModule. I have no problem getting them 
from a portlet using:


  | <service>
  |   <service-name>UserModule</service-name>
  |   <service-class>org.jboss.portal.core.modules.UserModule</service-class>
  |    <service-ref>:service=Module,type=User</service-ref>
  | </service>
  | 

  | UserModule userModule = (UserModule) context.getAttribute("UserModule");
  | 
Now I have to get a reference from a spring bean to handle some initialization 
code(same WAR as the portlets). I tried:

  | userModule = (UserModule) new 
InitialContext().lookup(ModuleConstants.USERMODULE_JNDINAME);
  | 
It works (well, it gets a reference) but whenever I try to use any function I 
get:

  | 2006-02-14 18:26:25,809 ERROR 
[org.jboss.portal.core.impl.role.RoleModuleImpl] Cannot count roles
  | 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:604)
  |     at 
org.jboss.portal.core.impl.role.RoleModuleImpl.getCurrentSession(RoleModuleImpl.java:382)
  |     at 
org.jboss.portal.core.impl.role.RoleModuleImpl.getRolesCount(RoleModuleImpl.java:293)
  |     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  |     at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  |     at ........
  | 
I'm using JBOSS Portal 2.4Alpha (latest version from CVS). Everything in the 
jmx-console looks fine. Any ideas?

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

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


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to