Bug 145 : With Inheritance get NullPointerException in BeanProperty.read(BeanProperty.java:457) on ...
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
2.1.0
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
27/08/2009
Updated 
27/08/2009
Type 
Bug
 
Attachments 
No attachments

Here is the stack trace
java.lang.NullPointerException
at com.avaje.ebean.server.deploy.BeanProperty.read(BeanProperty.java:457)
at com.avaje.ebean.server.query.SqlTreeNodeBean.load(SqlTreeNodeBean.java:220)
at com.avaje.ebean.server.query.CQuery.readRow(CQuery.java:444)
at com.avaje.ebean.server.query.CQuery.readBeanInternal(CQuery.java:475)
at com.avaje.ebean.server.query.CQuery.readTheRows(CQuery.java:559)
at com.avaje.ebean.server.query.CQuery.readCollection(CQuery.java:543)
at com.avaje.ebean.server.query.CQueryEngine.findMany(CQueryEngine.java:112)
at com.avaje.ebean.server.query.DefaultOrmQueryEngine.findMany(DefaultOrmQueryEngine.java:98)
at com.avaje.ebean.server.core.OrmQueryRequest.findList(OrmQueryRequest.java:228)
at com.avaje.ebean.server.core.DefaultServer.findList(DefaultServer.java:1054)
at com.avaje.ebean.server.deploy.BeanListHelp.refresh(BeanListHelp.java:72)
at com.avaje.ebean.server.deploy.BeanPropertyAssocMany.refresh(BeanPropertyAssocMany.java:186)
at com.avaje.ebean.server.core.DefaultServer.refreshManyInternal(DefaultServer.java:325)
at com.avaje.ebean.server.core.DefaultServer.lazyLoadMany(DefaultServer.java:280)

 
Rob 27 Aug 11:55
Scenario

The scenario to get this is that you need an inheritance hierarchy ... and some of the leaves of the inheritance reference other beans via ManyToOne and those beans are not the last in the SqlTree.

Rob 27 Aug 11:56
Fixed in HEAD

Fixed in HEAD.

Fix by adding read() onto BeanPropertyAssocOne ... otherwise it used the inherited read() method and errors :(

woResponse

Upload a file