2 Replies Latest reply on Aug 2, 2010 7:11 PM by Leo van den berg

    Deleting data in a isolated table

    Nifs Arpegiuz Newbie

      Hi everyone


      It should be grateful that you could help me; i've got a isolated table UserPermission, that has info of UserAccount; so if i delete a user, all his permissions must be deleted too


      Here the relevant code:


      @Name("userAccountHome")
      public class UserAccountHome extends EntityHome<UserAccount> {
      
          @In(value="#{userPermissionHome.newInstance()}")
          UserPermissionHome uphome;
      
          ...
      
          //This is a test code, so for now it doesn't look very good
          public boolean borrarUsuario(String nombreUsuario) {
          
              uphome.borrarPermisoDelUsuario(nombreUsuario);
              identityManager.deleteUser(nombreUsuario);
              return true;
          }
      
      }
      



      @Name("userPermissionHome")
      public class UserPermissionHome extends EntityHome<UserPermission> {
      
          ...
      
          public void setUserPermissionId(Long id) {
              setId(id);
          }
      
          public Long getUserPermissionId() {
              return (Long) getId();
          }
       
          public void borrarPermisoDelUsuario(String userz) {
      
              //For know i try to delete one register 
              setUserPermissionId(11L); 
      
              //I checked if the instance is the right one
              System.out.println("Look here: " + getInstance() + "with action: " + getInstance().getAction());
      
              remove(); //Here the problem begin
      
          }
      
      }
      



      When i execute this, i get:


      Exception during request processing:
      Caused by javax.el.ELException with message: "java.lang.NullPointerException"
      
      org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:339)
      org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:280)
      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:175)
      org.jboss.seam.navigation.Pages.callAction(Pages.java:692)
      org.jboss.seam.navigation.Pages.preRender(Pages.java:330)
      org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:561)
      org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:472)
      org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:148)
      org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:118)
      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:40)
      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:178)
      org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
      org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
      org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
      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:60)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
      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.framework.Controller.debug(Controller.java:197)
      org.jboss.seam.framework.Home.deletedMessage(Home.java:72)
      org.jboss.seam.framework.EntityHome.remove(EntityHome.java:109)
      com.naif.usuarios.userpermission.UserPermissionHome.borrarPermisoDelUsuario(UserPermissionHome.java:883)
      com.naif.usuarios.useraccount.UserAccountHome.borrarUsuario(UserAccountHome.java:161)
      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:32)
      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.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:97)
      org.jboss.seam.util.Work.workInTransaction(Work.java:47)
      org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:91)
      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:185)
      org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
      com.naif.usuarios.useraccount.UserAccountHome_$$_javassist_seam_3.borrarUsuario(UserAccountHome_$$_javassist_seam_3.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:335)
      org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:280)
      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:175)
      org.jboss.seam.navigation.Pages.callAction(Pages.java:692)
      org.jboss.seam.navigation.Pages.preRender(Pages.java:330)
      org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:561)
      org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:472)
      org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:148)
      org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:118)
      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:40)
      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:178)
      org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
      org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
      org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
      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:60)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
      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 checked some stuff, and i didn't find null values, so i don't know what could be the problem



      !!!Thanks for your time and attention!!!

        • 1. Re: Deleting data in a isolated table
          Nifs Arpegiuz Newbie

          I changed:


              public void borrarPermisoDelUsuario(String userz) {
          
                  //For know i try to delete one register 
                  setUserPermissionId(11L); 
          
                  //I changed this:
                  //System.out.println("Look here: " + getInstance() + "with action: " + getInstance().getAction());
                  //For this:
                  System.out.println("Menegado: " + getEntityClass().getName() + "con ppp: " + getId()); 
                  remove(); //Here the problem begin
          
              }
          
          



          Because i wanna see what is happening in the debug lines:


          org.jboss.seam.framework.Controller.debug(Controller.java:197)
          org.jboss.seam.framework.Home.deletedMessage(Home.java:72)
          



          In Home.java:


              protected void deletedMessage() {
          /*Line 72*/ debug("deleted entity #0 #1", getEntityClass().getName(), getId());
                      getStatusMessages().addFromResourceBundleOrDefault( INFO, getDeletedMessageKey(),getDeletedMessage().getExpressionString() );
              }
          



          And i get in my server log:


          2010-08-01 11:22:02,515 DEBUG [org.hibernate.engine.StatefulPersistenceContext] initializing non-lazy collections
          
          2010-08-01 11:22:02,515 INFO  [STDOUT] Menegado: com.naif.usuarios.UserPermissioncon ppp: 11
          
          2010-08-01 11:22:02,516 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Looking for a JTA transaction to join
          2010-08-01 11:22:02,516 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Transaction already joined
          2010-08-01 11:22:02,538 DEBUG [org.hibernate.hql.ast.QueryTranslatorImpl] parse() - HQL: delete from com.naif.usuarios.UserPermission p where p.target = :target
          2010-08-01 11:22:02,540 DEBUG [org.hibernate.hql.ast.AST] --- HQL AST ---
           \-[DELETE] 'delete'
              +-[FROM] 'FROM'
              |  \-[RANGE] 'RANGE'
              |     +-[DOT] '.'
              |     |  +-[DOT] '.'
              |     |  |  +-[DOT] '.'
              |     |  |  |  +-[IDENT] 'com'
              |     |  |  |  \-[IDENT] 'naif'
              |     |  |  \-[IDENT] 'usuarios'
              |     |  \-[IDENT] 'UserPermission'
              |     \-[ALIAS] 'p'
              \-[WHERE] 'where'
                 \-[EQ] '='
                    +-[DOT] '.'
                    |  +-[IDENT] 'p'
                    |  \-[IDENT] 'target'
                    \-[COLON] ':'
                       \-[IDENT] 'target'
          
          2010-08-01 11:22:02,541 DEBUG [org.hibernate.hql.ast.ErrorCounter] throwQueryException() : no errors
          2010-08-01 11:22:02,543 DEBUG [org.hibernate.hql.antlr.HqlSqlBaseWalker] delete << begin [level=1, statement=delete]
          2010-08-01 11:22:02,544 DEBUG [org.hibernate.hql.ast.tree.FromElement] FromClause{level=1} :  com.naif.usuarios.UserPermission (p) -> userpermis0_
          2010-08-01 11:22:02,544 DEBUG [org.hibernate.hql.ast.tree.FromReferenceNode] Resolved :  p -> id
          2010-08-01 11:22:02,544 DEBUG [org.hibernate.hql.ast.tree.DotNode] getDataType() : target -> org.hibernate.type.StringType@16e14f9
          2010-08-01 11:22:02,544 DEBUG [org.hibernate.hql.ast.tree.FromReferenceNode] Resolved :  p.target -> target
          2010-08-01 11:22:02,544 DEBUG [org.hibernate.hql.antlr.HqlSqlBaseWalker] delete : finishing up [level=1, statement=delete]
          2010-08-01 11:22:02,544 DEBUG [org.hibernate.hql.antlr.HqlSqlBaseWalker] delete >> end [level=1, statement=delete]
          2010-08-01 11:22:02,545 DEBUG [org.hibernate.hql.ast.AST] --- SQL AST ---
           \-[DELETE] DeleteStatement: 'delete'  querySpaces (user_permission)
              +-[FROM] FromClause: 'FROM' FromClause{level=1, fromElementCounter=1, fromElements=1, fromElementByClassAlias=[p], fromElementByTableAlias=[userpermis0_], fromElementsByPath=[], collectionJoinFromElementsByPath=[], impliedElements=[]}
              |  \-[FROM_FRAGMENT] FromElement: 'user_permission' FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=p,role=null,tableName=user_permission,tableAlias=userpermis0_,origin=null,colums={,className=com.naif.usuarios.UserPermission}}
              \-[WHERE] SqlNode: 'where'
                 \-[EQ] BinaryLogicOperatorNode: '='
                    +-[DOT] DotNode: 'target' {propertyName=target,dereferenceType=4,propertyPath=target,path=p.target,tableAlias=userpermis0_,className=com.naif.usuarios.UserPermission,classAlias=p}
                    |  +-[ALIAS_REF] IdentNode: 'id' {alias=p, className=com.naif.usuarios.UserPermission, tableAlias=userpermis0_}
                    |  \-[IDENT] IdentNode: 'target' {originalText=target}
                    \-[NAMED_PARAM] ParameterNode: '?' {name=target, expectedType=org.hibernate.type.StringType@16e14f9}
          
          2010-08-01 11:22:02,545 DEBUG [org.hibernate.hql.ast.ErrorCounter] throwQueryException() : no errors
          2010-08-01 11:22:02,550 DEBUG [org.hibernate.hql.ast.ErrorCounter] throwQueryException() : no errors
          2010-08-01 11:22:02,551 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] processing flush-time cascades
          2010-08-01 11:22:02,551 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] dirty checking collections
          2010-08-01 11:22:02,551 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Flushed: 0 insertions, 0 updates, 1 deletions to 8 objects
          2010-08-01 11:22:02,551 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
          2010-08-01 11:22:02,551 DEBUG [org.hibernate.pretty.Printer] listing entities:
          2010-08-01 11:22:02,551 DEBUG [org.hibernate.pretty.Printer] com.naif.usuarios.UserPermission{id=11, discriminator=user, action=simamatr.inscripciones.consulta, target=permisosSima, recipient=user1}
          2010-08-01 11:22:02,551 DEBUG [org.hibernate.pretty.Printer] com.naif.usuarios.UserPermission{id=12, discriminator=user, action=simamatr.inscripciones.impresion, target=permisosSima, recipient=user1}
          2010-08-01 11:22:02,551 DEBUG [org.hibernate.pretty.Printer] com.naif.usuarios.UserPermission{id=9, discriminator=user, action=simamatr.inscripciones, target=permisosSima, recipient=user1}
          2010-08-01 11:22:02,551 DEBUG [org.hibernate.pretty.Printer] com.naif.usuarios.UserPermission{id=10, discriminator=user, action=simamatr.inscripciones.inscripcion, target=permisosSima, recipient=user1}
          2010-08-01 11:22:02,551 DEBUG [org.hibernate.pretty.Printer] com.naif.usuarios.UserPermission{id=16, discriminator=user, action=simamatr.utilidades.usuarios.asignarpermisos, target=permisosSima, recipient=user1}
          2010-08-01 11:22:02,552 DEBUG [org.hibernate.pretty.Printer] com.naif.usuarios.UserPermission{id=15, discriminator=user, action=simamatr.utilidades.usuarios.crearroles, target=permisosSima, recipient=user1}
          2010-08-01 11:22:02,552 DEBUG [org.hibernate.pretty.Printer] com.naif.usuarios.UserPermission{id=14, discriminator=user, action=simamatr.utilidades.usuarios.crearusuarios, target=permisosSima, recipient=user1}
          2010-08-01 11:22:02,552 DEBUG [org.hibernate.pretty.Printer] com.naif.usuarios.UserPermission{id=13, discriminator=user, action=simamatr.utilidades, target=permisosSima, recipient=user1}
          2010-08-01 11:22:02,552 DEBUG [org.hibernate.engine.ActionQueue] changes must be flushed to space: user_permission
          2010-08-01 11:22:02,552 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
          2010-08-01 11:22:02,552 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
          2010-08-01 11:22:02,552 DEBUG [org.hibernate.SQL] 
              delete 
              from
                  user_permission 
              where
                  id=?
          2010-08-01 11:22:02,552 INFO  [STDOUT] Hibernate: 
              delete 
              from
                  user_permission 
              where
                  id=?
          2010-08-01 11:22:02,553 DEBUG [org.hibernate.jdbc.AbstractBatcher] Executing batch size: 1
          2010-08-01 11:22:02,555 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
          2010-08-01 11:22:02,555 DEBUG [org.hibernate.jdbc.ConnectionManager] skipping aggressive-release due to flush cycle
          2010-08-01 11:22:02,555 DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
          2010-08-01 11:22:02,555 DEBUG [org.hibernate.jdbc.ConnectionManager] releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
          2010-08-01 11:22:02,557 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
          2010-08-01 11:22:02,557 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
          2010-08-01 11:22:02,557 DEBUG [org.hibernate.SQL] 
              delete 
              from
                  user_permission 
              where
                  target=?
          2010-08-01 11:22:02,557 INFO  [STDOUT] Hibernate: 
              delete 
              from
                  user_permission 
              where
                  target=?
          2010-08-01 11:22:02,558 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
          2010-08-01 11:22:02,559 DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
          2010-08-01 11:22:02,559 DEBUG [org.hibernate.jdbc.ConnectionManager] releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
          2010-08-01 11:22:02,559 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] processing flush-time cascades
          2010-08-01 11:22:02,559 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] dirty checking collections
          2010-08-01 11:22:02,559 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Flushed: 0 insertions, 0 updates, 0 deletions to 7 objects
          2010-08-01 11:22:02,559 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
          2010-08-01 11:22:02,559 DEBUG [org.hibernate.pretty.Printer] listing entities:
          2010-08-01 11:22:02,559 DEBUG [org.hibernate.pretty.Printer] com.naif.usuarios.UserPermission{id=12, discriminator=user, action=simamatr.inscripciones.impresion, target=permisosSima, recipient=user1}
          2010-08-01 11:22:02,560 DEBUG [org.hibernate.pretty.Printer] com.naif.usuarios.UserPermission{id=9, discriminator=user, action=simamatr.inscripciones, target=permisosSima, recipient=user1}
          2010-08-01 11:22:02,560 DEBUG [org.hibernate.pretty.Printer] com.naif.usuarios.UserPermission{id=10, discriminator=user, action=simamatr.inscripciones.inscripcion, target=permisosSima, recipient=user1}
          2010-08-01 11:22:02,560 DEBUG [org.hibernate.pretty.Printer] com.naif.usuarios.UserPermission{id=16, discriminator=user, action=simamatr.utilidades.usuarios.asignarpermisos, target=permisosSima, recipient=user1}
          2010-08-01 11:22:02,560 DEBUG [org.hibernate.pretty.Printer] com.naif.usuarios.UserPermission{id=15, discriminator=user, action=simamatr.utilidades.usuarios.crearroles, target=permisosSima, recipient=user1}
          2010-08-01 11:22:02,560 DEBUG [org.hibernate.pretty.Printer] com.naif.usuarios.UserPermission{id=14, discriminator=user, action=simamatr.utilidades.usuarios.crearusuarios, target=permisosSima, recipient=user1}
          2010-08-01 11:22:02,560 DEBUG [org.hibernate.pretty.Printer] com.naif.usuarios.UserPermission{id=13, discriminator=user, action=simamatr.utilidades, target=permisosSima, recipient=user1}
          2010-08-01 11:22:02,560 DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
          2010-08-01 11:22:02,567 DEBUG [org.jboss.seam.exception.Exceptions] reading exception mappings from /WEB-INF/pages.xml
          2010-08-01 11:22:02,580 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@1eef1eb, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@73d10f{ url=null ,addedOrder=0}
          2010-08-01 11:22:02,580 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@1eef1eb, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@1a23f67{ url=null ,addedOrder=0}
          2010-08-01 11:22:02,582 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@1eef1eb, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@f0a6e8{ url=null ,addedOrder=0}
          2010-08-01 11:22:02,583 DEBUG [org.jboss.seam.util.Resources] Loaded resource from context classloader: jar:file:/D:/javasrv/jboss-4.2.3.GA/server/default/tmp/deploy/tmp5208957256939513917Permisos-RC1-1.0.0.ear-contents/Permisos-RC1-1.0.0-exp.war/WEB-INF/lib/jboss-seam-debug.jar!/META-INF/debug.xhtml
          2010-08-01 11:22:02,585 DEBUG [org.jboss.seam.exception.DebugPageHandler] redirecting to debug page
          java.lang.NullPointerException
               at org.jboss.seam.framework.Controller.debug(Controller.java:197)
               at org.jboss.seam.framework.Home.deletedMessage(Home.java:72)
               at org.jboss.seam.framework.EntityHome.remove(EntityHome.java:109)
               at com.naif.usuarios.userpermission.UserPermissionHome.borrarPermisoDelUsuario(UserPermissionHome.java:884)
               at com.naif.usuarios.useraccount.UserAccountHome.borrarUsuario(UserAccountHome.java:161)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  ... You know the rest ...
          



          I don't know what is happening, i don't know where is the null value; any help would be great


          !!!Thank you so much!!!

          • 2. Re: Deleting data in a isolated table
            Leo van den berg Master

            Hi,


            you have a null value in your log parameter. You getId() is possibly returning a null. Check it value before writing the debug.


            Leo