Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Simple JPA Program using Eclipselink 1.1 in Eclipse

 
Pawan Choure
Greenhorn
Posts: 27
Eclipse IDE Oracle Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
users.java

usertester.java

persistence.xml


orm.xml

I have created a JPAProject in Eclipse and above are code files i have used but when i am trying to run i am getting following error.


so please help me out to solve the above issue
 
James Sutherland
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Odd, the error says you did not set your jdbc properties, but you do seem to be setting them in your persistence.xml.

Ensure that you are using the persistence.xml that you think you are (in META-INF), and you don't have any old ones on your classpath. Maybe try to run it outside of Eclipse so you know exactly what is on your classpath. Also ensure you have your JDBC driver on the classpath, and check your log for other errors.
 
Pawan Choure
Greenhorn
Posts: 27
Eclipse IDE Oracle Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Finally I got it working.I create a a new JPA Project from Scratch and was still facing the same issue but finally got it working my changing the name of Database to MySQL.

user class

usertester class

orm.xml

persistence.xml
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic