0
當我按照restful project in netbeans然後我得到的錯誤。Persistence.xml
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
我確定問題出在persistence.xml中。這是我的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>
我使用toplink連接mysql數據庫。我有glassfishv3和Netbeans6.7。我無法弄清楚這個問題。哪裏有問題?我怎樣才能解決這個問題?
我從http://www.oracle.com/technology/software/products/ias/htdocs/1111topsoft.html下載了Oracle TopLink 11gRelease 1,然後將JAR加載到我的項目中。什麼都沒有發生 – Iguramu 2009-09-08 10:54:37
您是否已將它們添加到您的項目的NetBeans CLASSPATH中?下載是必要的,但不夠。 – duffymo 2009-09-08 22:49:32