[jboss-user] [JBoss Portal] - problem while implementing portal identity API with a jndi l
loucs
do-not-reply at jboss.com
Tue Apr 29 06:43:51 EDT 2008
hello,
I will try to expose my situation in details :
I'm working on a project using jboss-portal.
i've got an ear archive deployed which contains portlets for jboss portal, and a lot of entity beans mapped with JPA.
I'm trying to reimplement portal Identity API (HibernateUserModule, HibernateUserProfileModule, etc...) to map users and roles in my custom database. So i've done a jar file containing my implementation of this modules. this jar isn't in my main ear package where entity beans are, but is deployed in the lib dir of jboss-portal.sar.
So the thing i'm trying to do is :
- from my implementation of HibernateUserModule (in the jar contained in lib dir of portal), i'm trying to access an ejb session from my ear package via jndi lookup. ((NameOfEJBLocalInterface) new InitialContext().lookup('/myproj-ear/NameOfEJB/local') ). my implementation is only extending the original HibernateUserModule for testing purpose. I have just overrided a fonction where i do the jndi lookup.(findUserByUserName). I've modified correctly the identity-config file of portal for it to use my implementation.
- I verified in the jboss jmx console that my ejb session is correctly mapped in the jndi context, and it is in the global jndi namespace under myproj-ear/NameOfEJB/local.
additional infos :
JBoss version : 4.2.0 GA
Portal version : 2.6.4 GA
EJB3
now here comes my problem: :)
i got this exception at the execution of the lookup :
java.lang.IllegalStateException: Wrong tx on thread: expected TransactionImple < ac, BasicAction: -3f57fe93:cf77:4816ea73:38b status: ActionStatus.ABORT_ONLY >, actual TransactionImple < ac, BasicAction: -3f57fe93:cf77:4816ea73:395 status: ActionStatus.RUNNING >
at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:162)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
at org.jboss.aspects.tx.TxInterceptor$RequiresNew.invoke(TxInterceptor.java:262)
at org.jboss.portal.core.aspects.server.TransactionInterceptor$invoke_N5143606530999904530.invokeNext(TransactionInterceptor$invoke_N5143606530999904530.java)
at org.jboss.portal.core.aspects.server.TransactionInterceptor.invoke(TransactionInterceptor.java)
at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
at org.jboss.portal.server.aspects.LockInterceptor$InternalLock.invoke(LockInterceptor.java:69)
at org.jboss.portal.server.aspects.LockInterceptor.invoke(LockInterceptor.java:130)
at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
at org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:157)
at org.jboss.portal.server.servlet.PortalServlet.service(PortalServlet.java:250)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
i tested that with different semantics with intentional mistakes in the jndiName, and i got "namingException : myMistakeName not bound".
so i figure it means i'm doing the lookup in the good way, but it seems to be a problem of transaction management (ie: the exception).
The bean extending HibernateUserModule in my jar is a POJO, so i think i'll have to deal with transaction management myself. (but i don't really know about this subject). I will continue my investigations but any clues would be really appreciable :)
Regards,
--
Lucas
Montes
ps: if you need some other information on the project i'll answer with pleasure :)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147475#4147475
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147475
More information about the jboss-user
mailing list