Details
Description
ERROR [org.mortbay.log] failed InitializationServlet
java.lang.NullPointerException
at org.jboss.jetty.security.JBossUserRealm.pushRole(JBossUserRealm.java:430)
at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:419)
Small investigation gives:
ServerHolder.initServlet
Principal user=null;
try {
// Handle run as
if (_runAs!=null && _realm!=null)
419: user=_realm.pushRole(null,_runAs);
^^^^-------- So at some point it invokes pushRole with NULL
and JBossUserRealm.pushRole
public Principal pushRole(Principal user, String role)
Same situation in org.mortbay.jetty.security.HashUserRealm.class haled in a following way:
public Principal pushRole(Principal user, String role)
So I am wondering if we are missing something in JBossUserRealm.
I was trying to move working webapp from jboss4.0.2 with jetty5.1.11 to jboss4.0.5 with jetty-6.1-SNAPSHOT
Fixed null pointer by ensuring there is always a user - created a JBossNobodyUserPrincipal which is always present and has the run-as role pushed onto it.
Also added code to set up the SecurityAssocation with the pushed role so that the role is propagated during ejb calls in jboss.
I haven't been able to test that ejb calls will use the run-as role correctly, so if someone could verify that, and update this issue with the results I'd be grateful.
The fix is in svn trunk at rev 1436, and will shortly be released as 6.1.0rc2.