JPA /Hibernate - model class not found

195 views
Skip to first unread message

Holger Burde

unread,
Oct 13, 2013, 7:47:58 AM10/13/13
to play-fr...@googlegroups.com
Hi;

I am quite new to Scala / Play and right now struggling to get JPA working. I think i did all relevant steps:

1 application.conf
....

db.default.jndiName=DefaultDS


jpa.debugSQL=true

jpa.default=PDU1 // name from persistence.xml

...


2 persistence.xml


Name is PDU1 - all model classes (model.xxx) are added to the persistence.xml

location is conf/META-INF/


3 Model classes

Each Model class has a javax.persistence Entity Annotation

Each class is located in controllers.model



Error:

Caused by: javax.persistence.PersistenceException: [PersistenceUnit: PDU1] class or package not found

Caused by: java.lang.ClassNotFoundException: model.ESummary


I am running the current stable release. 


thx in advance


hb

Holger Burde

unread,
Oct 13, 2013, 4:12:43 PM10/13/13
to play-fr...@googlegroups.com
Hi;

Ok i resolved the error by adding javaJpa to Build.scala and now this error pops up:

javax.persistence.PersistenceException: No Persistence provider for EntityManager named true


val appDependencies = Seq(

    // Add your project dependencies here,

    jdbc,

    anorm,

    javaJpa,

    "org.hibernate" % "hibernate-entitymanager" % "4.2.6.Final",

    "org.hibernate" % "hibernate-core" % "4.2.6.Final",

    "mysql" % "mysql-connector-java" % "5.1.26"

  )


persistence.xml

..

  <provider>org.hibernate.ejb.HibernatePersistence</provider>

..


Any idea what this may cause?


hb

Reply all
Reply to author
Forward
0 new messages