[jboss-jira] [JBoss JIRA] Created: (EJBTHREE-761) SessionContext.getCallerPrincipal() throws NullPointerException in embedded container

John Gilbert (JIRA) jira-events at jboss.com
Wed Oct 25 11:42:41 EDT 2006


SessionContext.getCallerPrincipal() throws NullPointerException in embedded container
-------------------------------------------------------------------------------------

                 Key: EJBTHREE-761
                 URL: http://jira.jboss.com/jira/browse/EJBTHREE-761
             Project: EJB 3.0
          Issue Type: Patch
          Components: Security
    Affects Versions: EJB 3.0 RC8 - FD
            Reporter: John Gilbert


The exception happens in org.jboss.security.plugins.JaasSecurityManager.getPrincipal(Principal principal) when it is synchronized on domainCache. domainCache is null because org.jboss.ejb3.embedded.JaasSecurityManagerService does not initialize it.

There are two possible fixes:
1 - org.jboss.security.plugins.JaasSecurityManager should check for null first like it does in most of the methods.
2 - have org.jboss.ejb3.embedded.JaasSecurityManagerService initialize the cache with a mock cache policy. This is what I did to fix mine.



	private static JaasSecurityManager getSecurityManager(String name) {
                       ...
			manager = new JaasSecurityManager(name,
					new SecurityAssociationHandler());
			manager.setCachePolicy(new MockCachePolicy());               //MockCachePolicy is just a noop impl
                        ...
	}



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list