0

When executed in Eclipse, it works fine. But when executed via executable jar facing the following error enter image description here

Here is the persistence.xml file I have been using.

enter image description here

Following are the pom entries that I am using for JPA enter image description here

If anyone faced the same issue and resolved, please share the ideas. As we need to deliver for testing, any help at earliest would be very helpful.

Vivek Gupta
  • 2,534
  • 3
  • 15
  • 28
gangatharan
  • 781
  • 1
  • 12
  • 28
  • persistence.xml under META-INF in the JAR. All requisite jars in the CLASSPATH. That's all there is. –  Dec 19 '17 at 07:35

2 Answers2

1

It's possible that your jar file doesn't include external jar files. Try using the assembly plugin for maven:

See a description of it here.

Titonien
  • 31
  • 2
  • 5
0

Please try with this in provider

org.hibernate.jpa.HibernatePersistenceProvider

rab
  • 207
  • 2
  • 6
  • Just before tried. Now its not works even in Eclipse, also in executable jar. Facing the exception. Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named amber – gangatharan Dec 19 '17 at 07:24
  • can you check whether hibernate library files present on your executable jar? – rab Dec 19 '17 at 07:31