持久性.xml
当我关注 netbeans 中的 Restful 项目 时,我收到错误。
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。我无法弄清楚问题所在。问题出在哪里?我该如何解决这个问题?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这只不过是一个简单的 CLASSPATH 问题。您的 CLASSPATH 中没有 TopLink JAR。 NetBeans 假设 TopLink 是您的 JPA 实现。
找到 JAR 并将其提供给 NetBeans 或切换到 Hibernate 作为 JPA 实现。
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.