Too much errors with play2.0 + java + mysql5.0

536 Views Asked by At

I am still trying to learn how to create a search from with search action and database. However I have too many errors:

  • [RuntimeException: No JPA EntityManagerFactory configured for name [default]] This error appear when i fix the application.conf file like:

    *db.default.driver=com.mysql.jdbc.Driver

    db.default.url="jdbc:mysql://localhost/search"

    db.default.user=root

    db.default.password=123456

    db.default.jndiName=DefaultDS*

- PersistenceException: No Persistence provider for EntityManager named defaultPersistenceUnit when i insert this into : application.conf

  *jpa.default=defaultPersistenceUnit*

I searched all over http://stackoverflow.com but I couldn't find any answers, and my app still isn't working. Help me fix it. Thanks for help :)

You guys can see my code in here : Error : RuntimeException: No JPA EntityManagerFactory configured for name [default]

2

There are 2 best solutions below

0
On

in play framework distribution you can find /samples folder. I am completely sure there is a project with configured DB connections and so. Try to reuse that.

have you created the persistence unit to /conf/META-INF ?

1
On

Did you add the different dependencies in your project?

http://www.playframework.com/documentation/2.1.x/JavaJPA