1 Reply Latest reply on Jun 10, 2010 10:28 AM by Anil Saldanha

    Principal: USERNAME and security context post-mapping roles=null

    Sebastian Bayerlein Newbie

      Hey,

       


      When calling an secured EJB from a servlet I get the following error. Has somebody an idea, what's the error? The servlet and the ejb are deployed in the same EAR.

       


      08:12:16,910 ERROR [SecurityInterceptor] Error in Security Interceptor
      java.lang.SecurityException: Denied: caller with subject=Betreff:
              Principal: USERNAME
      and security context post-mapping roles=null: ejbMethod=public abstract com.test.DBCheckRemote com.test.DBCheckHome.create() throws java.rmi.RemoteException,javax.ejb.CreateException
              at org.jboss.ejb.plugins.SecurityInterceptor.checkSecurityContext(SecurityInterceptor.java:368)
              at org.jboss.ejb.plugins.SecurityInterceptor.process(SecurityInterceptor.java:243)
              at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:205)
              at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:187)
              at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:56)
              at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:125)
              at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:173)
              at org.jboss.ejb.plugins.TxInterceptorBMT.invokeHome(TxInterceptorBMT.java:71)
              at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invokeHome(StatefulSessionInstanceInterceptor.java:148)
              at org.jboss.ejb.plugins.security.PreSecurityInterceptor.process(PreSecurityInterceptor.java:136)
              at org.jboss.ejb.plugins.security.PreSecurityInterceptor.invokeHome(PreSecurityInterceptor.java:88)
              at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:132)
              at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:107)
              at org.jboss.ejb.SessionContainer.internalInvokeHome(SessionContainer.java:639)
              at org.jboss.ejb.Container.invoke(Container.java:1046)
              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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
              at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
              at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
              at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
              at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
              at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.run(LocalInvoker.java:158)
              at java.security.AccessController.doPrivileged(Native Method)
              at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:177)
              at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
              at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:209)
              at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:195)
              at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
              at org.jboss.proxy.ejb.SecurityContextInterceptor.invoke(SecurityContextInterceptor.java:64)
              at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:68)
              at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:184)
              at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:101)
              at $Proxy2660.create(Unknown Source)
              at com.finec.b3.springbridge.service.impl.BapiServiceImpl.testSpring(BapiServiceImpl.java:424)
              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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154)
              at org.springframework.remoting.support.RemoteInvocationTraceInterceptor.invoke(RemoteInvocationTraceInterceptor.java:70)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
              at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
              at $Proxy2659.testSpring(Unknown Source)
              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.springframework.remoting.support.RemoteInvocation.invoke(RemoteInvocation.java:181)
              at org.springframework.remoting.support.DefaultRemoteInvocationExecutor.invoke(DefaultRemoteInvocationExecutor.java:38)
              at org.springframework.remoting.support.RemoteInvocationBasedExporter.invoke(RemoteInvocationBasedExporter.java:76)
              at org.springframework.remoting.support.RemoteInvocationBasedExporter.invokeAndCreateResult(RemoteInvocationBasedExporter.java:112)
              at org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.handleRequest(HttpInvokerServiceExporter.java:117)
              at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:47)
              at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:820)
              at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:755)
              at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396)
              at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:360)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
              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.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:275)
              at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:274)
              at java.security.AccessController.doPrivileged(Native Method)
              at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
              at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:307)
              at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:167)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:283)
              at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:56)
              at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189)
              at java.security.AccessController.doPrivileged(Native Method)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              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.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:275)

       

      Best regards,

      sebbay