-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate : JPA and Maven 2 Correct Setup (Confused)
PostPosted: Wed Nov 10, 2010 4:17 pm 
Newbie

Joined: Wed Nov 10, 2010 4:08 pm
Posts: 1
Hi;

I have read through Hibernate/JPA/Maven documentation and several online forums but it is absolutely unclear how to setup Maven 2 to work with JPA for Hibernate. I haven't been able to get it to work. I have tried setting numerous dependencies (Hibernate, JPA, javax.persistence, etc.) but any combination I try does not seem to work. Maven is extremely frustrating...

I have created a Maven quickstart project
I have created a simple unit test in src/test/java that tests getting an EntityManager
I have created a persistence.xml file in src/main/resources and/or src/test/resources and configured it for MySQL
I have created a pom.xml in the project root with dependencies (many failed attempts to guess which were required)

In Maven, I get a successful compilation, but the unit test fails saying that no persistence provider was found. I'm quite certain that Maven finds the persistence.xml file, as it moves it to the target/ folder.

When I setup a simple java app and run the unit test manually, it is successful. So I know my persistence.xml file is fine, I know my unit test class is fine, I correctly specify all the required libraries/jar files, the problem is with the Maven configuration.

I would greatly appreciate a simple explanation or a downloadable zip/jar showing the proper setting for Maven 2 to work with Hibernate and JPA. Which Hibernate dependencies do I need? Do I need a JPA or javax.persistence dependency? Do I need a transaction or other dependency? Do I need a MySQL dependency? Do I need some other dependency(ies) like javassist?


Thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.