Problem using JPA console
I'm having problems runing the JPA console. I have a simple Java EE project and wanted to try this but all I got is this message:
jpa-ql> select c.id from Cliente c
java.lang.RuntimeException: javax.persistence.PersistenceException: No Persistence provider for EntityManager named EscuderServerPersistenceUnit
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:84)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54)
The datasource console (simple jdbc + sql) works fine. The such "EscuderServerPersistenceUnit" is configured to the datasource. I'm using GlassFish 3 so I've configured the JPA provider to EclipseLink.
Please sign in to leave a comment.
This is because of incorrect JPA configuration. Make sure you could start your persistence unit manually. I hope you googled the message. See http://stackoverflow.com/questions/3230798/eclipselink-no-persistence-provider-for-entitymanager-named. Probably, you just need this in the persistence.xml:
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>Also, you should properly configure jpa facet - choose available datasourcee, appropriate persitence unit, correct provider. Also, you have to provide more data regarding your configuration to get the answer. At least persistence.xml + jpa facet configuration.
Thanks for the answer.
Don't know how to do this. Or perhaps is what I'm doing right now. I just open the persistence tab, it shows my persistence unit, right click, select "Open Query Console".
idea couln't connect to the database using jta datasource configured in the glassfish. You can see there are no any information in the facet descriptor, there are no any association with the datasource. try to create an alternate persistence.xml providing the jdbc url and credentials explicitly: http://wiki.eclipse.org/EclipseLink/Examples/JPA/RCP#Persistence.xml
Regards, Alex