Thanks, Oleg

Oleg Nitz writes:
 > Hi Tom,
 > 
 > Tom Cook wrote:
 > TC> When I do this and then call ctx.getCallerPrincipal() in my stateful
 > TC> session bean, I get the null pointer exception below.  The line in
 > TC> EnterpriseContext.java is:
 > 
 > TC>       public Principal getCallerPrincipal() 
 > TC>        { 
 > TC>          if ( principal != null && beanPrincipal == null ) {
 > >>             beanPrincipal = con.getRealmMapping().getPrincipal( principal );
 > TC>          }
 > TC>          return beanPrincipal;
 > TC>        }
 > 
 > TC> I guess this means either the Container for this bean is null
 > TC> (unlikely?) or the real mapping reported by the container is null.
 > I guess you are right, I'll add the check for null realm mapping.
 > 
 > TC> How do I go about rectifying this?
 > You should specify realm mapping and authentication module in
 > container-configuration either for each jboss.xml or globally, in
 > conf/default/standardjboss.xml, e.g.:
 > 
 >     <authentication-module>java:/jaas/other</authentication-module>
 >     <role-mapping-manager>java:/jaas/other</role-mapping-manager>
 > 
 > where "other" corresponds to a section in conf/default/auth.conf.
 > jBoss distribution contains two JAAS server login modules:
 > org.jboss.security.SimpleServerLoginModule and
 > org.jboss.security.DatabaseServerLoginModule,
 > and you would probably wish to write your own.
 > 
 > Also it is possible to go without JAAS at all. Then you should use
 > security MLETs specified in jboss.conf, either existing
 > org.jboss.security.SimpleRealmMappingService and
 > org.jboss.security.EJBSecurityManagerService
 > or write your own.
 > In this case jboss.xml could contain
 > 
 > 
 >     <authentication-module>java:/EJBSecurityManager</authentication-module>
 >     <role-mapping-manager>java:/SimpleRealmMapping</role-mapping-manager>
 > 
 > Best regards,
 >  Oleg 
 > 
 > 
 > 
 > 
 > --
 > --------------------------------------------------------------
 > To subscribe:        [EMAIL PROTECTED]
 > To unsubscribe:      [EMAIL PROTECTED]
 > Problems?:           [EMAIL PROTECTED]
 > 


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to