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

Carlo de Wolf (JIRA) jira-events at lists.jboss.org
Mon Oct 29 09:17:03 EDT 2007


     [ http://jira.jboss.com/jira/browse/EJBTHREE-761?page=all ]

Carlo de Wolf resolved EJBTHREE-761.
------------------------------------

    Resolution: Duplicate Issue

> 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
>         Assigned To: Carlo de Wolf
>
> 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