No Persistence Provider for Entitymanager named x

Asked

Viewed 100 times

-3

This my project does not recognize my Persistence Provider. It follows the same below.

inserir a descrição da imagem aqui

Your location plus dependencies:

inserir a descrição da imagem aqui

I’m calling the same through a very simple XHTML using a Managebean. Below images:

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

Finally follows the error image.

inserir a descrição da imagem aqui

  • 2

    @Jokanaan, try taking your <provider/> of the comment area? <!-- --> in the persistence.xml

  • @Jocsã try to get persistence.xml out of META-INF, leave it only inside Resources. And also try to do what Marcos suggested.

  • Hello @Renan the version of Hibernate is the same as the version of Parent, that is, the other projects we use here. We use Nexus, and we always try to use the same versions.

  • @Marcossousa I’ve left without Provider, and I’ve also used both org.hibernate.jpa.Hibernatepersistenceprovider and org.hibernate.ejb.Hibernatepersistence and nothing.

  • @Diegoaugusto I tried the same way. I even put inside the java folder, but without success. I thank everyone for their attention!

  • The correct location is within the /Resources META-INF, you need to add the Provider <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> I also saw a blank in the true value in show_sql.

  • 1

    These code images help little, or even harm. Prefer to put the same code.

  • Is this class up to date? Because in your error log you accuse line 24 of the Viewjocsa class, but line 24 there is a blank line. If it is, clean the design and test again.

  • I managed to solve the problem, I do not know why they gave - in question. Anyway... I will answer the question.

  • @Dilneicunha persistence was in the right place, the problem was other. Grateful!

  • @bigown preferences, each has its own. Grateful!

  • @Giulianabezerra managed to solve the problem and closed this topic. Grateful!

  • Read this: http://meta.pt.stackoverflow.com/q/5149/132

  • 1

    @John as Victor showed is not a matter of preference. It makes the work of those who want to help you very difficult. Since you are asking for help, would you be so kind as to facilitate the work of this person who is earning nothing and has no obligation whatsoever.

Show 9 more comments

1 answer

3

The problem was simple! The code was correct...

There was a problem because the in my pom.xml made explicit for the dependencies to be Provider. That is, at the time of going up to the server, War went without the dependencies.

To solve the problem, I started using a server with the project libs already inside the server lib folder and this solved the problem. You could also use a specific attribute (which I now can’t remember the name) to force War to generate with the dependencies, but this was not the case since the default here in the sector is to leave the libs on the server itself.

Thank you for your attention!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.