I'm trying to write a Java EE application that uses JPA to access a database. Until now I just used the @Entity annotation and left everything else to the default state (for example the persistence.xml file was using _TimerPool as the jta-data-source, and I didn't create any db).
So I wanted to try and use an actual database. I went into the Services screen, JavaBD > Create new database, set it up with a name and password.
The DB's url: jdbc:derby://localhost:1527/Prova
Then I created the persistence.xml file for my application through Glassfish's wizard:
<persistence-unit name="JobsPU" transaction-type="JTA">
<jta-data-source>java:app/Prova</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="javax.persistence.schema-generation.database.action" value="create"/>
<property name="javax.persistence.schema-generation.database.target" value="database-and-scripts"/>
<property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.ClientDriver"/>
<property name="javax.persistence.jdbc.url" value="jdbc:derby://localhost:1527/Prova"/>
<property name="javax.persistence.jdbc.user" value="paolo"/>
<property name="javax.persistence.jdbc.password" value="paolo"/>
</properties>
</persistence-unit>
And when I try to deploy I get this exception:
Grave: Exception while preparing the app : Invalid resource : { ResourceInfo : (jndiName=java:app/Prova__pm), (applicationName=Jobs) }
com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Invalid resource : { ResourceInfo : (jndiName=java:app/Prova__pm), (applicationName=Jobs) }
Seems to be related to the JNDI naming. Of what I honestly don't know, I'm still trying to learn. If I go to Glassfish's console, under the JNDI listing I can't see anything that seems to be related to my database (not in JDBC Connection Pools nor in JDBC Resources). What should I do?
Thank you very much in advance for any help.