JBoss Community

How to implement a custom identity model for JBoss Portal?

created by Thomas Raab in JBoss Portal - View the full discussion

Hello!

 

I want to implement a custom identity model in order to connect to a proprietary webservice providing user information.

So I followed the instructions on http://docs.jboss.com/jbportal/v2.7.1/referenceGuide/html/identity.html.

 

I am using JBoss Portal 2.7.2 with JBoss AS 4.2.3; java version 1.6.0_29

 

Here are the steps that I've done:

 

Creating a new maven project, pom.xml snippet:


<dependency>
     <groupId>org.jboss.portal.identity</groupId>
     <artifactId>identity-identity</artifactId>
     <version>1.0.7</version>
     <scope>provided</scope>
</dependency>

 

 

Implementation of the User interface:

 

 


package com.mycompany.myIdentity;

import org.jboss.portal.identity.IdentityException;
import org.jboss.portal.identity.User;

public class MyUserImpl implements User {
...
}

 

 

Packaged to a jar file and deployed (= copied) to

\jboss-portal-2.7.2\server\default\deploy\jboss-portal.sar\lib.

 

Changes in \jboss-portal-2.7.2\server\default\deploy\jboss-portal.sar\conf\identity\identity-config.xml,

replacing the existing User-type module with the new one (it doesn't need any config):

 


<module>
     <type>User</type>

     <service-name>portal:service=Module,type=User</service-name>
     <class>com.mycompany.myIdentity.MyUserImpl</class>

     <config/>
</module>

 

 

After starting the server by double-clicking the run.bat und browsing the site http://localhost:8080/portal

I get the following exception:

 

 

exception

 

javax.servlet.ServletException: org.hibernate.HibernateException: Unable to locate current JTA transaction

     org.jboss.portal.server.servlet.PortalServlet.service(PortalServlet.java:278)

     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

     org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

 

root cause

 

org.hibernate.HibernateException: Unable to locate current JTA transaction

     org.hibernate.context.JTASessionContext.currentSession(JTASessionContext.java:61)

     org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:544)

     org.jboss.portal.core.impl.model.portal.PersistentPortalObjectContainer.getObjectNode(PersistentPortalObjectContainer.java:252)

     org.jboss.portal.core.impl.model.portal.AbstractPortalObjectContainer.getContext(AbstractPortalObjectContainer.java:112)

     org.jboss.portal.core.impl.model.portal.AbstractPortalObjectContainer.getContext(AbstractPortalObjectContainer.java:81)

     org.jboss.portal.core.model.portal.DefaultPortalCommandFactory.doMapping(DefaultPortalCommandFactory.java:72)

     org.jboss.portal.core.controller.Controller.handle(Controller.java:252)

     org.jboss.portal.server.RequestControllerDispatcher.invoke(RequestControllerDispatcher.java:51)

     org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:131)

     org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:157)

     org.jboss.portal.server.servlet.PortalServlet.service(PortalServlet.java:252)

     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

     org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

 

 

I get the same exception even without deploying the jar file, just by changing the identity-config.xml file. So I assume

that my jar isn't loaded at all. Furthermore my new module has nothing to do with databases and thus needs no JTA transaction.

 

So what am I missing to get this thing working?

 

Thanks in advance for your help.

Reply to this message by going to Community

Start a new discussion in JBoss Portal at Community