[2.4] Hibernate does not map classes in production mode

320 views
Skip to first unread message

laguiz

unread,
Jun 10, 2015, 4:37:39 AM6/10/15
to play-fr...@googlegroups.com
Hi,

Short version :

Annotated Hibernate Classes are not mapped during Hibernate initialisation in PROD mode but it works in DEV mode. 


Long version:

We have a different behaviour with Hibernate (JPA Module) between DEV mode and PROD mode.

To reproduce just clone this project and try with `run` and `start` : https://github.com/laguiz/play24-hibernate-issue

In DEV : We can query Mapped Hibernate Entity `User`
In PROD (`start` or `dist`) we get this error : ```Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: User is not mapped```

In fact when we look at Hibernate debug logs in PROD mode we don't see any class mapped during the initialisation (in dev we see classes mapped).


We tried different version of Hibernate (hibernate-entitymanager) but we always got the same result (In Play 2.3 it worked with tested hibernate versions : 4.3.8.Final and 4.3.9.Final).

We don't know where to look to make progress. What disturb us the most is not that it's not working but the fact that we have a different behaviour between dev and prod mode.

We can help to troubleshoot if we know where to look.

In the other hand if you see any mistake in the sample project let us know.

Versions :
  • Play 2.4
  • SBT 0.13.8
  • Hibernate Entity Manager 4.3.8 and 4.3.9
  • Macos and Windows
  • JRE and JDK 1.8.0_31





Matthias Kurz

unread,
Jun 10, 2015, 7:14:33 AM6/10/15
to play-fr...@googlegroups.com

laguiz

unread,
Jun 10, 2015, 7:41:06 AM6/10/15
to play-fr...@googlegroups.com
Sorry for the duplicate post... I did search before but did not found that post :/.

Thank you for the workaround it work properly.

Maxence
Reply all
Reply to author
Forward
0 new messages