持久性.xml

发布于 2024-08-04 07:50:40 字数 1715 浏览 3 评论 0原文

当我关注 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

辞取 2024-08-11 07:50:40

这只不过是一个简单的 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文