users@glassfish.java.net

Re: JDBCRealm: Can I map users/groups to roles using database?

From: <glassfish_at_javadesktop.org>
Date: Thu, 08 Jan 2009 11:39:52 PST

Here's an update on my progress, unfortunately I still don't have a working solution:

I created a JACCRoleMapper implementation, placed my jar file and the inmemory.jacc.provider.jar in SUNWAppserver/lib. I added the simple JACC provider to domain.xml, configured it and added the jvm-option: -Dsimple.jacc.provider.JACCRoleMapper.class=com.ttv.ui.security.TTVRoleMapper

The behavior I'm experiencing is the same as the issue I mentioned above, when I tried defining a one to one mapping in sun-web.xml. My role mapper *does* work, but I still get a false return value from request.isUserInRole()... even though I can access a page that uses the same role in a web.xml <auth-constraint/>.

I found someone talking about similar issues, although they seem specific to EJB so I'm not sure if it is related: https://glassfish.dev.java.net/issues/show_bug.cgi?id=6800


I wanted to see what would happen in Glassfish V3, so I installed it on my system. I have a completely different issue here. No matter where I put the jar that contains my RoleMapper class I end up with some kind of classpath issue. I've tried putting it in just about every directory, from the domain lib, the global one, the modules folder where the inmemory.jacc.provider.jar is and I get one of the following depending on where I put my jar file:

java.lang.RuntimeException: java.lang.NoClassDefFoundError: com/sun/enterprise/security/jacc/provider/JACCRoleMapper
        at com.sun.enterprise.security.jacc.provider.SimplePolicyConfiguration.<clinit>(SimplePolicyConfiguration.java:141)

-- OR --

java.lang.RuntimeException: java.lang.ClassNotFoundException: com.ttv.ui.security.TTVRoleMapper
        at com.sun.enterprise.security.jacc.provider.SimplePolicyConfiguration.<clinit>(SimplePolicyConfiguration.java:141)

-- OR --

java.lang.RuntimeException: java.lang.ClassNotFoundException: com.sun.enterprise.security.jacc.provider.SimplePolicyProvider
        at com.sun.enterprise.security.PolicyLoader.loadPolicy(PolicyLoader.java:175)

I'm not sure how to proceed from this point.
[Message sent by forum member 'pwardrip' (pwardrip)]

http://forums.java.net/jive/thread.jspa?messageID=324831