[jboss-dev-forums] [Design of EJB 3.0] - Re: EJBTHREE-615 still present in Embedded-ALPHA9

jazir1979 do-not-reply at jboss.com
Thu Jan 25 03:51:58 EST 2007


Hi Bill,

We did some further testing today using the original CalculatorBean example provided with the old embedded EJB3 stuff.  

I found that the bug that was reported originally -- a NullPointerException when calling EJBContext.getCallerPrincipal() is definitely FIXED in the latest code from SVN.

However, the (similar) bug that I'm having still occurs.

You can reproduce it by modifying the add() method in CalculatorBean.java to call ctx.isCallerInRole("student")  (or "teacher", or anything..).  You will get an IllegalArgumentException in Util.getSubjectRoles(), because the Subject is null:

  |      [java] java.lang.IllegalArgumentException: Subject is null
  |     [java]     at org.jboss.security.Util.getSubjectRoles(Util.java:632)
  |     [java]     at
  | org.jboss.security.plugins.JBossAuthorizationManager.getCurrentRoles(JBossAu
  | thorizationManager.java:302)
  |     [java]     at
  | org.jboss.security.plugins.JBossAuthorizationManager.doesUserHaveRole(JBossA
  | uthorizationManager.java:126)
  |     [java]     at
  | org.jboss.security.plugins.JaasSecurityManager.doesUserHaveRole(JaasSecurity
  | Manager.java:401)
  |     [java]     at
  | org.jboss.ejb3.BaseSessionContext.isCallerInRole(BaseSessionContext.java:233
  | )
  |     [java]     at
  | com.synyati.spurwing.test.bean.CalculatorBean.add(CalculatorBean.java:51)
  | 

thanks for your help on this one,
Daniel.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006244#4006244

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006244



More information about the jboss-dev-forums mailing list