users@glassfish.java.net

Re: SEVERE: Linked policy contexts have different roleToSubjectMaps

From: <glassfish_at_javadesktop.org>
Date: Tue, 22 Jun 2010 15:40:52 PDT

Hello Kumar,

thanks for your quick reply and sorry for the delay on my side. I couldn't send you the original EAR, because it contains proprietary sources which our customer doesn't want to publish. I thus created a little demo to reproduce the problem.

Additionally, the original problem doesn't occur in our real project anymore, because we don't separate the EJBs in separated JARs anymore, as they currently only serve as REST services (we'll need more later, but for now, this is a functional workaround).

While re-implementing the little demo, I traced the problem down a bit, already: It only happens, when my WAR's META-INF/MANIFEST.MF references the EJB-JAR (which I usually need, of course, since my servlets have to access the EJB-JAR's classes).

Here's the demo: http://nightlabs.de/~marco/glassfish/2010-06-23.00/test-ear.7z

It contains both sources and binaries in both versions (functional and failing).

To test it, you need to do the following:

1) Place the file GlassFishRealmAuthentication.jar into your ${glassfish}/domains/activedomain/lib directory.

2) Start the GlassFish and execute this command:

./asadmin create-auth-realm --classname org.nightlabs.glassfish.security.auth.CustomLoginModuleRealm --property jaas-context=NightLabs NightLabsRealm

3) Add the following to your ${glassfish}/domains/activedomain/config/login.conf

NightLabs {
  org.nightlabs.glassfish.security.auth.CustomLoginModule required;
};

4) Restart GlassFish.

5) Deploy the TestEAR.ear from the "success" directory (in the 7z-archive) into ${glassfish}/domains/activedomain/autodeploy/

=> This should work fine.

6) Deploy the TestEAR.ear from the "failure" directory and overwrite the previous file.

=> Exception happens.

The exception I currently get is not exactly the same as I got before. It now says "org.glassfish.deployment.common.DeploymentException: Error in linking security policy for TestEAR -- Inconsistent Module State" and I'm not sure, if I am really reproducing the same error, but I'm pretty sure that I reproduce an error which should not occur.

Best regards, Marco :-)
[Message sent by forum member 'nlmarco']

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