This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception in JPA fetch

 
sudha murty
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using JPA for db transactions.
My problem is, I am able to insert the data in the tables properly, but while fetching the data, it gives the following exception:

java.lang.NoClassDefFoundError: javax/persistence/Persistence

The error is on the line --
EntityManagerFactory emf = Persistence.createEntityManagerFactory("testjpa");

There are two classes in persistence.xml
The code snippet for insert and fetch is similar. I mean the entityManager initialization and all.
Please help.

Thanks,
Sudha
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic