0 Replies Latest reply on Dec 11, 2008 1:55 PM by Augusto Cesar Lima

    Weird NPE when trying to grant permission

    Augusto Cesar Lima Newbie

      Hi everyone,
      I'm using Seam 2.1.0.SP1 and trying to make a simple test to exercite seam's permission stores but I'm facing a strange problem when invoking grantPermission() method of PermissionManager. It all starts from a simple call to my PermissionAction.grantPermission(User) method:


      <h:dataTable id="users" value="#{users}" var="user"     rendered="#{users.rowCount>0}">
                               ...
      
           <h:column id="column3" rendered="#{s:hasRole('admin')}">
           <f:facet id="ActionFacet" name="header">Perfis</f:facet>
           <s:link id="viewRoles" value="Alterar" action="#{roleAction.selectUser(user)}" />
           <s:link id="ativar" value="Ativar" rendered="#{s:hasPermission(user,'mudar')}" action="#{permissionAction.grantPermission(user)}" />
                                              
                                              ...



      Then in the PermissionAction:



      @Name("permissionAction")
      public class PermissionAction {
      
           @In
           private PermissionManager permissionManager;     
           
           @In
           private Identity identity;
           
           
           public void grantPermission(UserAccount user) {
      
                Permission p = new Permission(user, "mudar", identity.getPrincipal());
                                      
                permissionManager.grantPermission(p);          
      
           }
                                    ...


      I debugged and checked that none of the paremeters of the Permission p are null.
      While executing the permissionManager.grantPermission(p); this shows up in the browser window(not in the appserver console):



      Exception during request processing:
      Caused by javax.el.ELException with message: "java.lang.RuntimeException: Could not grant permission"
      
      org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:333)
      org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:274)
      org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)
      org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65)
      org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
      org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
      org.jboss.seam.core.Expressions$2.invoke(Expressions.java:174)
      org.jboss.seam.navigation.Pages.callAction(Pages.java:711)
      org.jboss.seam.navigation.Pages.preRender(Pages.java:349)
      org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:562)
      org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:473)
      org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:146)
      org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
      com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:214)
      com.sun.faces.lifecycle.Phase.doPhase(Phase.java:96)
      com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
      javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:38)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
      org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
      org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
      org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
      org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:51)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
      org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
      org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
      java.lang.Thread.run(Thread.java:619)
      
      Caused by java.lang.RuntimeException with message: "Could not grant permission"
      
      org.jboss.seam.security.permission.JpaPermissionStore.updatePermissionActions(JpaPermissionStore.java:430)
      org.jboss.seam.security.permission.JpaPermissionStore.grantPermission(JpaPermissionStore.java:250)
      org.jboss.seam.security.permission.PermissionManager.grantPermission(PermissionManager.java:103)
      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:597)
      org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
      org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
      org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
      org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
      org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
      org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
      org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
      org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
      org.jboss.seam.security.permission.PermissionManager_$$_javassist_6.grantPermission(PermissionManager_$$_javassist_6.java)
      action.PermissionAction.grantPermission(PermissionAction.java:27)
      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:597)
      org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
      org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
      org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
      org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
      org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
      org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
      org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
      org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
      org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
      action.PermissionAction_$$_javassist_5.grantPermission(PermissionAction_$$_javassist_5.java)
      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:597)
      org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
      org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:274)
      org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)
      org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65)
      org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
      org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
      org.jboss.seam.core.Expressions$2.invoke(Expressions.java:174)
      org.jboss.seam.navigation.Pages.callAction(Pages.java:711)
      org.jboss.seam.navigation.Pages.preRender(Pages.java:349)
      org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:562)
      org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:473)
      org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:146)
      org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
      com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:214)
      com.sun.faces.lifecycle.Phase.doPhase(Phase.java:96)
      com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
      javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:38)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
      org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
      org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
      org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
      org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:51)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
      org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
      org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
      java.lang.Thread.run(Thread.java:619)
      
      Caused by java.lang.NullPointerException with message: ""
      
      org.jboss.seam.security.permission.JpaPermissionStore.updatePermissionActions(JpaPermissionStore.java:374)
      org.jboss.seam.security.permission.JpaPermissionStore.grantPermission(JpaPermissionStore.java:250)
      org.jboss.seam.security.permission.PermissionManager.grantPermission(PermissionManager.java:103)
      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:597)
      org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
      org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
      org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
      org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
      org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
      org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
      org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
      org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
      org.jboss.seam.security.permission.PermissionManager_$$_javassist_6.grantPermission(PermissionManager_$$_javassist_6.java)
      action.PermissionAction.grantPermission(PermissionAction.java:27)
      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:597)
      org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
      org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
      org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
      org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
      org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
      org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
      org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
      org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
      org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
      action.PermissionAction_$$_javassist_5.grantPermission(PermissionAction_$$_javassist_5.java)
      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:597)
      org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
      org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:274)
      org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)
      org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65)
      org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
      org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
      org.jboss.seam.core.Expressions$2.invoke(Expressions.java:174)
      org.jboss.seam.navigation.Pages.callAction(Pages.java:711)
      org.jboss.seam.navigation.Pages.preRender(Pages.java:349)
      org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:562)
      org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:473)
      org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:146)
      org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
      com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:214)
      com.sun.faces.lifecycle.Phase.doPhase(Phase.java:96)
      com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
      javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:38)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
      org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
      org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
      org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
      org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:51)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
      org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
      org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
      java.lang.Thread.run(Thread.java:619)



      I've did everything to try to mimic the SeamSpace example but I couldn't solve this error.


      My UserAccount class (The target of the permission) is :



      @Entity
      @Table(name = "user_account")
      @NamedNativeQueries( { @NamedNativeQuery(name = IUser.USER_BY_STORED_PROCEDURE, resultClass = UserAccount.class, query = "{ call SELECT_USERS(?, ?, ?) }", hints = {
                @QueryHint(name = "org.hibernate.callable", value = "true"),
                @QueryHint(name = "org.hibernate.readOnly", value = "true") }) })
      @NamedQueries( {
                @NamedQuery(name = IUser.USER_VALIDATE, query = "select u from UserAccount u where u.login = :login and u.password = :password"),
                @NamedQuery(name = IUser.USER_BY_LOGIN, query = "select u from UserAccount u where u.login=:login"),
                @NamedQuery(name = IUser.USER_BY_NAME, query = "select u from UserAccount u where lower(u.userInfo.name) like lower(:name) order by u.userInfo.name") })     
      @Permissions({
         @Permission(action = "mudar"),
         @Permission(action = "desmudar")
      })
      //@Identifier(value=TestIdentifier.class)
      @Identifier(value=EntityIdentifierStrategy.class)
      @Name("userAccount")
      public class UserAccount implements IUser {
      
           private static final long serialVersionUID = 1L;
           @Id
           @GeneratedValue(strategy = GenerationType.AUTO)
           @Column(name = "id")
           private Integer id;
           @Column(name = "login")
           private String login;
           @Column(name = "password")
           private String password;
      
           @ManyToMany(targetEntity = Role.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY)
           @JoinTable(name = "user_role", joinColumns = @JoinColumn(name = "user_id"), inverseJoinColumns = @JoinColumn(name = "role_id"))
           private Set<Role> roles;
           
           @OneToOne(targetEntity=UserInfo.class)
           @JoinColumn(name = "userinfoId")
           private UserInfo userInfo;
           
           public UserAccount(){
                this.userInfo = new UserInfo();
           }
           
           public UserInfo getUserInfo() {
                return userInfo;
           }
      
           public void setUserInfo(UserInfo userInfo) {
                this.userInfo = userInfo;
           }
      
           public Integer getId() {
                return id;
           }
      
           public void setId(Integer id) {
                this.id = id;
           }
      
           @NotNull
           @UserPrincipal
           public String getLogin() {
                return login;
           }
      
           public void setLogin(String login) {
                this.login = login;
           }
      
           @NotNull
           @UserPassword(hash = "none")
           public String getPassword() {
                return password;
           }
      
           public void setPassword(String password) {
                this.password = password;
           }
      
           @UserRoles
           public Set<Role> getRoles() {
                return roles;
           }
      
           public void setRoles(Set<Role> roles) {
                this.roles = roles;
           }
      
           @Transient
           public Set<Role> getRoles(ISystem system) {
                Set<Role> systemRoles = new HashSet<Role>();
      
                for (Role role : roles) {
                     if (role.getSystem().equals(system)) {
                          systemRoles.add(role);
                     }
                }
      
                return systemRoles;
           }
           
           @Override
           public int hashCode() {
                int hash = 0;
                hash += (id != null ? id.hashCode() : 0);
                return hash;
           }
      
           @Override
           public boolean equals(Object object) {
                // TODO: Warning - this method won't work in the case the id fields are
                // not set
                if (!(object instanceof UserAccount)) {
                     return false;
                }
                UserAccount other = (UserAccount) object;
                if ((this.id == null && other.id != null)
                          || (this.id != null && !this.id.equals(other.id))) {
                     return false;
                }
                return true;
           }
      }
      
      
      



      I've also tryed without any @Identifier annotations and with my custom identifier strategy TestIdentifier:



      public class TestIdentifier implements IdentifierStrategy {
           
                public boolean canIdentify(Class arg0) {
                     return arg0.equals(UserAccount.class);
                }
           
                public String getIdentifier(Object arg0) {          
                     return "user"+((UserAccount) arg0).getId();
                }
           
           }



      Unfortunaly the same NPE occurs in all the cases.
      Any assistance will be much appreciated,
      Thanks !