views:

1244

answers:

1

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"&gt;
  <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?

+1  A: 

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.

duffymo
I downloaded Oracle TopLink 11gRelease 1 from http://www.oracle.com/technology/software/products/ias/htdocs/1111topsoft.html after that i load JAR's to my project. Nothing happened
Iguramu
Did you add them to the NetBeans CLASSPATH for your project? Downloading is necessary but not sufficient.
duffymo