Sporadic EntityNotFoundExceptions after upgrading to 2.7.7

243 views
Skip to first unread message

Christie

unread,
Aug 13, 2012, 9:48:50 AM8/13/12
to eb...@googlegroups.com
Hi,

I am getting sporadic EntityNotFoundExceptions on Ebean 2.7.7. 
I have a standalone Java method that imports a large number of text files into a database. This method does not do any entity deletes, it only adds entities to the DB.  If I run this import method multiple times, it will crash on different lines of import text (it's never the same lines), but the method it crashes on is usually the following:

[com.widget.importing.Importer]08/6/2012 21:21:14 PM ERROR: javax.persistence.EntityNotFoundException : Bean has been deleted - lazy loading failed
      at com.avaje.ebean.bean.EntityBeanIntercept.loadBeanInternal(EntityBeanIntercept.java:535)
      at com.avaje.ebean.bean.EntityBeanIntercept.loadBean(EntityBeanIntercept.java:499)
      at com.avaje.ebean.bean.EntityBeanIntercept.preGetter(EntityBeanIntercept.java:623)
      at com.widget.importing.Widget._ebean_get_volumeAmount(Widget.java:4)
      at com.widget.importing.Widget.getVolumeAmount(Widget.java:149)
      ....

volumeAmount is a Double that apparently is getting lazy loaded, so the error message is a little deceiving (the lazy load failure was not on an entity and the Widget itself does still exist in the DB).

I have gotten this error once or twice during the import method when trying to access an actual entity, but haven't been able to reproduce it to check to see that the entity actually is there (I'm pretty sure it would be since this method doesn't do any deletes).

I have verified that this happens in 2.7.7 and 2.7.6-SNAPSHOT.  When I revert to 2.7.5 the problem disappears.  Any ideas what could be the issue?  I browsed the SVN logs for EntityBeanIntercept and it looks like a number of changes have been made since 2.7.5.  Since I can't reproduce the issue reliably I'm not sure if this is even fixable on your end.

Thanks,

Christie

Mario Ivankovits

unread,
Aug 14, 2012, 2:03:19 AM8/14/12
to eb...@googlegroups.com

Hmmmm …..

 

Is the Widget the root entity you loaded, or is it itself the property of another entity?

If so, does the root entity contain two (or more) Widget properties?

 

Ciao,

Mario

Rob Bygrave

unread,
Aug 22, 2012, 9:50:40 PM8/22/12
to eb...@googlegroups.com
Where there any updates to this issue?

Thanks, Rob.

Christie

unread,
Aug 22, 2012, 10:23:21 PM8/22/12
to eb...@googlegroups.com
Sorry - been working on other areas of the project.

After reverting back to 2.7.5 I ran the import a couple times.  Unfortunately it crashed on one of those imports, so it wasn't anything to do with the 2.7.7 upgrade.  It isn't crashing on the getVolumeAmount() call anymore, but on a call to an entity off the Widget entity (Widget contains an object of type ItemPackage).  The Widget is the root entity loaded, and does not contain any other Widgets.  Just an ItemPackage (and some other objects and fields).


javax.persistence.EntityNotFoundException : Bean has been deleted - lazy loading failed
      at com.avaje.ebean.bean.EntityBeanIntercept.loadBeanInternal(EntityBeanIntercept.java:535)
      at com.avaje.ebean.bean.EntityBeanIntercept.loadBean(EntityBeanIntercept.java:499)
      at com.avaje.ebean.bean.EntityBeanIntercept.preGetter(EntityBeanIntercept.java:623)
      at com.example.Widget._ebean_get_itemPackage(Widget.java:4)
      at com.example.Widget.getItemPackage(Widget.java:90)

I put in some debug code and put a breakpoint in the Ebean source code to try to get an idea of what is wrong but of course when I did that it chose not to crash.  :)  I'm not sure what to do about it so I've put it on the back burner for now.

Christie

Rob Bygrave

unread,
Aug 23, 2012, 6:32:42 AM8/23/12
to eb...@googlegroups.com
Ok, thanks. 

Christie

unread,
Oct 24, 2012, 1:41:08 PM10/24/12
to eb...@googlegroups.com
I never did get to the bottom of it.  I "solved" it by wrapping the problem method in a try-catch and then calling the method a second time if the exception was thrown.

Christie

On Monday, October 22, 2012 5:37:53 AM UTC-6, Fabio Falci Rodrigues wrote:
Any news about this issue?

The same error is occurring to me, sporadically.

javax.persistence.EntityNotFoundException: Bean has been deleted - lazy loading failed
at com.avaje.ebean.bean.EntityBeanIntercept.loadBeanInternal(EntityBeanIntercept.java:535)
at com.avaje.ebean.bean.EntityBeanIntercept.loadBean(EntityBeanIntercept.java:499)
at com.avaje.ebean.bean.EntityBeanIntercept.preGetter(EntityBeanIntercept.java:623)
at com.quantiza.re.models.parametros.IndiceCriaPos$$EntityBean$sqlite@233284820.getCategoria(IndiceCriaPos.java:1)

And I'm not deleting anything.

Thanks!

Fabio Falci Rodrigues

unread,
Oct 25, 2012, 11:59:08 AM10/25/12
to eb...@googlegroups.com
That exactly the same solution I did.
Reply all
Reply to author
Forward
0 new messages