[jboss-user] [Security & JAAS/JBoss] - NullPointerException in getCallerPrincipal()

johanmicoud do-not-reply at jboss.com
Tue Jul 29 10:15:29 EDT 2008


I have upgraded to JBoss 5.0.0 CR1. 
Client side, my authentification uses JndiLoginContextFactory with

env.put(Context.SECURITY_PRINCIPAL,"user");
env.put(Context.SECURITY_CREDENTIALS, "password");

Server side, every call to getCallerPrincipal() raises a NullPointerException in EJBContextHelper (!!).

Here is the stack trace :

javax.ejb.EJBException: java.lang.NullPointerException
	at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:67)
	at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
	at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
	at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
	at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
	at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:157)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
	at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
	at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
	at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
	at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:390)
	at org.jboss.ejb3.session.ClassProxyHack._dynamicInvoke(ClassProxyHack.java:52)
	at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
	at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
	at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:847)
	at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:681)
	at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:634)
	at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:459)
	at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:197)
Caused by: java.lang.NullPointerException
	at org.jboss.ejb3.security.helpers.EJBContextHelper.getCallerPrincipal(EJBContextHelper.java:91)
	at org.jboss.ejb3.EJBContextImpl.getCallerPrincipal(EJBContextImpl.java:138)
	at fr.aeag.redevances.services.dossier.impl.DossierServiceImpl.findByCriteria(DossierServiceImpl.java:300)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
	at org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:69)
	at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor$InvocationContext.proceed(InvocationContextInterceptor.java:138)
	at fr.aeag.commons.profiling.ProfilingInterceptor.profile(ProfilingInterceptor.java:28)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)


Any idea ? This problem is very annoying ...

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

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



More information about the jboss-user mailing list