No Persistence provider for EntityManager named Hibernate error

No Persistence provider for EntityManager named

If you are working on hibernate, then there are two ways to provide the configuration to it. Either you would be using hibernate.cfg.xml or persistence.xml

In both cases, hibernate would be using the information like the connection string information and classes associated with tables.

If you are using persistence.xml and you are getting No Persistence provider for EntityManager named error, then there the following would be an issue and here is how you solve those.

1.

The persistence name is either not given or it is misspelled

On your persistence.xml file, look for and make sure the name is assigned the the correct name that the error is showing as missing

2.

The persistence.xml file cannot be found

In the case of hibernate.cfg.xml file, it would be placed under resources. But in the case of persistence.xml it should be placed under resources/META-INF/persistence.xml

The above are the main ones causing the error. Try those along with valid xml notation and those should take care the problem.

Have you ever seen this kind of apache error before and its solution?

Java Tomcat error: can not access a member of class with modifiers

You asked to pull from the remote but did not specify the branch github error

Maven error Annotations are not supported in -source 1.3

eclipse j2ee error There are No resources that can be added or removed from the server

sasl.h not found error

composer install-update killed on vagrant machine

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*