Iguramu
Iguramu

Reputation: 2110

Persistence.xml

When i follow restful project in netbeans then i get the error.

SEVERE: Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method
java.lang.RuntimeException: java.lang.ClassNotFoundException: oracle.toplink.essentials.PersistenceProvider
Caused by: java.lang.ClassNotFoundException: oracle.toplink.essentials.PersistenceProvider

SEVERE: Exception while deploying the app
java.lang.RuntimeException: java.lang.ClassNotFoundException: oracle.toplink.essentials.PersistenceProvider
Caused by: java.lang.ClassNotFoundException: oracle.toplink.essentials.PersistenceProvider

I am sure that the problem is in the persistence.xml. That is my persistence.xml : )

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
  <persistence-unit name="ayniPU" transaction-type="JTA">
    <provider>oracle.toplink.essentials.PersistenceProvider</provider>
    <jta-data-source>jndi/ayni</jta-data-source>
    <properties>
      <property name="toplink.ddl-generation" value="drop-and-create-tables"/>
       <property name="toplink.jdbc.user" value="root"/>
    <property name="toplink.jdbc.password" value="3774634"/>
    </properties>
  </persistence-unit>
</persistence>

i use toplink to connect mysql database. I have glassfishv3 and Netbeans6.7. I can not figure out the problem. Where is the problem? How can i fix this?

Upvotes: 0

Views: 5025

Answers (1)

duffymo
duffymo

Reputation: 308763

It's nothing more than a simple CLASSPATH problem. You don't have the TopLink JARs in your CLASSPATH. NetBeans is assuming that TopLink is your JPA implementation.

Find the JARs and make them available to NetBeans or switch to Hibernate as your JPA implementation.

Upvotes: 1

Related Questions