Opened 13 years ago

Closed 13 years ago

#1441 closed defect (fixed)

Null pointer exception when checking dependent items on deleted user

Reported by: base Owned by: everyone
Priority: minor Milestone: BASE 2.14.2
Component: core Version:
Keywords: NullPointerException delete user Cc:

Description (last modified by Nicklas Nordborg)


After I deleted a user and want to see items 'using User item', I get this NPE:

java.lang.NullPointerException? on page /views/trashcan/view_item.jsp

Version 	BASE 2.13.1 (build #5134; schema #75)
Web server 	Apache Tomcat/6.0.20
Database Server 	PostgreSQL 8.3.8
Database Dialect 	org.hibernate.dialect.PostgreSQLDialect
JDBC Driver 	org.postgresql.Driver (version 8.4)
Java runtime 	Java(TM) SE Runtime Environment (1.6.0_03-b05), Sun Microsystems Inc.
Operating system 	Linux amd64 2.6.9-78.0.22.ELsmp
Memory 	Total: 486.3 MB
Free: 262.1 MB
Max: 910.3 MB
Browser 	Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/2009102918 CentOS/3.0.15-3.el5.centos Firefox/3.0.15
Error message 	
Stack trace 	

java.lang.NullPointerException ItemProxy.compareTo( ItemProxy.compareTo( java.util.TreeMap.put( java.util.TreeSet.add( BasicItem.addUsingItems( User.getUsingItems( org.apache.jsp.views.trashcan.view_005fitem_jsp._jspService( org.apache.jasper.runtime.HttpJspBase.service( javax.servlet.http.HttpServlet.service( org.apache.jasper.servlet.JspServletWrapper.service( org.apache.jasper.servlet.JspServlet.serviceJspFile( org.apache.jasper.servlet.JspServlet.service( javax.servlet.http.HttpServlet.service( org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( org.apache.catalina.core.ApplicationFilterChain.doFilter( net.sf.basedb.clients.web.servlet.CharacterEncodingFilter.doFilter( org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( org.apache.catalina.core.ApplicationFilterChain.doFilter( org.apache.catalina.core.StandardWrapperValve.invoke( org.apache.catalina.core.StandardContextValve.invoke( org.apache.catalina.core.StandardHostValve.invoke( org.apache.catalina.valves.ErrorReportValve.invoke( org.apache.catalina.core.StandardEngineValve.invoke( org.apache.catalina.connector.CoyoteAdapter.service( org.apache.coyote.http11.Http11Processor.process( org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process($

Change History (3)

comment:1 Changed 13 years ago by Nicklas Nordborg

Description: modified (diff)
Milestone: BASE 2.4.2

I get this also, and I think the same error can happen for other items as well.

It seems like root cause is found in the BasicItem.addUsingItems() method. The call to item.getClass() can return a dynamic Hibernate-generated proxy class. This class is not known by BASE and the Item.fromDataClass() returns null. The problems should be easy to fix by calling Item.fromDataObject(item) instead.

comment:2 Changed 13 years ago by Nicklas Nordborg

Milestone: BASE 2.4.2BASE 2.14.2

comment:3 Changed 13 years ago by Nicklas Nordborg

Resolution: fixed
Status: newclosed

(In [5191]) Fixes #1441: Null pointer exception when checking dependent items on deleted user

Note: See TracTickets for help on using tickets.