468,133 Members | 1,203 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,133 developers. It's quick & easy.

Java Persistence in a Desktop Application

myusernotyours
188 100+
Hi all,

Am trying to create a Java Desktop App that uses Java Persistence in Netbeans.
The database is MS Access but I tried with Mysql and got the same error.
When I run the app( Create the entity manager), I keep getting the following...

Expand|Select|Wrap|Line Numbers
  1. Exception in thread "AWT-EventQueue-0" javax.persistence.PersistenceException: No Persistence provider for EntityManager named ReceiptingPU:  The following providers:
  2. oracle.toplink.essentials.PersistenceProvider
  3. oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider
  4. Returned null to createEntityManagerFactory.
  5.  
  6.         at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:154)
  7.         at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
  8.  
Here is the persistence.xml

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
  3.   <persistence-unit name="ReceiptingPU" transaction-type="RESOURCE_LOCAL">
  4.     <provider>oracle.toplink.essentials.PersistenceProvider</provider>
  5.     <class>receipting.entities.Receipt</class>
  6.     <class>receipting.entities.Consumer</class>
  7.     <class>receipting.entities.Receipttransaction</class>
  8.     <class>receipting.entities.Users</class>
  9.     <properties>
  10.       <property name="toplink.jdbc.user" value="user"/>
  11.       <property name="toplink.jdbc.password" value="user"/>
  12.       <property name="toplink.jdbc.url" value="jdbc:mysql://localhost/watering"/>
  13.       <property name="toplink.jdbc.driver" value="com.mysql.jdbc.Driver"/>
  14.     </properties>
  15.   </persistence-unit>
  16. </persistence>
I have the toplink library correctly in the class path. Any one with some light please?


Alex
Feb 24 '09 #1
0 2064

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Frank Grimm | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.