[jboss-user] [JBoss Portal] - How to implement a custom identity model for JBoss Portal?
Thomas Raab
do-not-reply at jboss.com
Fri Nov 18 03:08:49 EST 2011
Thomas Raab [http://community.jboss.org/people/prisemut] created the discussion
"How to implement a custom identity model for JBoss Portal?"
To view the discussion, visit: http://community.jboss.org/message/637123#637123
--------------------------------------------------------------
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 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 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
[http://community.jboss.org/message/637123#637123]
Start a new discussion in JBoss Portal at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2011]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20111118/2f7d801e/attachment-0001.html
More information about the jboss-user
mailing list