Called: javax.persistence.EntityNotFoundException: Bean deleted - failed boot attempt

EDIT: Additional Information:

play.api.Application$$anon$1: Execution exception[[EntityNotFoundException: Bean has been deleted - lazy loading failed]]
2015-11-23T04:48:23.432891+00:00 app[web.1]:    at play.api.Application$class.handleError(Application.scala:296) ~[com.typesafe.play.play_2.10-2.3.7.jar:2.3.7]
 2015-11-23T04:48:23.432891+00:00 app[web.1]:   at play.api.DefaultApplication.handleError(Application.scala:402) [com.typesafe.play.play_2.10-2.3.7.jar:2.3.7]
2015-11-23T04:48:23.432893+00:00 app[web.1]:    at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [com.typesafe.play.play_2.10-2.3.7.jar:2.3.7]
2015-11-23T04:48:23.432894+00:00 app[web.1]:    at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [com.typesafe.play.play_2.10-2.3.7.jar:2.3.7]
2015-11-23T04:48:23.432895+00:00 app[web.1]:    at scala.Option.map(Option.scala:145) [org.scala-lang.scala-library-2.10.4.jar:na]
2015-11-23T04:48:23.432896+00:00 app[web.1]: Caused by: javax.persistence.EntityNotFoundException: Bean has been deleted - lazy loading failed
2015-11-23T04:48:23.432897+00:00 app[web.1]:    at com.avaje.ebean.bean.EntityBeanIntercept.loadBeanInternal(EntityBeanIntercept.java:516) ~[org.avaje.ebeanorm.avaje-ebeanorm-3.3.4.jar:na]
2015-11-23T04:48:23.432898+00:00 app[web.1]:    at com.avaje.ebean.bean.EntityBeanIntercept.loadBean(EntityBeanIntercept.java:480) ~[org.avaje.ebeanorm.avaje-ebeanorm-3.3.4.jar:na]
2015-11-23T04:48:23.432899+00:00 app[web.1]:    at com.avaje.ebean.bean.EntityBeanIntercept.preGetter(EntityBeanIntercept.java:583) ~[org.avaje.ebeanorm.avaje-ebeanorm-3.3.4.jar:na]
2015-11-23T04:48:23.432899+00:00 app[web.1]:    at models.Album._ebean_get_artist(Album.java:4)
2015-11-23T04:48:23.432900+00:00 app[web.1]:    at models.Album.getArtist(Album.java)

EDIT: Added parts for album definition:

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long id;
@Column(length = 254)
@Constraints.MaxLength(254)
@NotNull
public String name;
@Column(name = "fullname", length = 254)
@Constraints.MaxLength(254)
@NotNull
public String fullName;
public Integer year;
@ManyToOne
@JoinColumn(name = "artist")
public Artist artist;
@OneToMany(fetch = FetchType.EAGER, mappedBy = "album")
@OrderBy("name asc")
public List<Song> songs = Lists.newArrayList();
@OneToMany(fetch = FetchType.EAGER, mappedBy = "originalAlbum")
@OrderBy("name asc")
public List<Song> covers = Lists.newArrayList();

I looked at EntityNotFoundException: Bean was deleted - lazy loading failed

Somewhere there must be some kind of corrupted data. However, since the models I'm working with are quite complex, I am losing the beginning to start debugging.

Any tips? (Play Framework 2.3, Avaje Ebean 3.1.1) Upgrading to version 2.4 Framework is still the same issue.

+4
source share
1 answer

Here is what I use to find the root cause of ORM problems:

  • (), (-);
  • (), (), ;
  • ORM- (-);
  • ; ,
  • , ORM .

:

  • , Album (.. );
  • Album ;
  • , , ​​ ORM EBean.
  • , SQL; ,
  • , .

, , ORM. , , Play EBean, - , .

0

Source: https://habr.com/ru/post/1614987/


All Articles