我的学校有一个小的 Java 项目。我将 Eclipse Neon 与 JPA 图表编辑器和 JavaFX 一起使用。问题 -> 当我建立与数据库的连接时,一切正常(结构:项目 -> META-INF -> persistence.xml,通过 JPA 生成)。我没有更改persistence.xml中的文件夹名称或其他内容,我只在Main-class中工作并添加了一个新的DAO-class。现在我收到此错误消息,但不明白为什么。
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="Kursverwaltung" transaction-type="RESOURCE_LOCAL">
<class>model.Course</class>
<properties>
<property name="javax.persistence.jdbc.url" value="jdbc:oracle:thin:@localhost:1521:xe"/>
<property name="javax.persistence.jdbc.user" value="*right username*"/>
<property name="javax.persistence.jdbc.password" value="*right password*"/>
<property name="javax.persistence.jdbc.driver" value="oracle.jdbc.OracleDriver"/>
<property name="hibernate.hbm2ddl.auto" value="create"/>
</properties>
</persistence-unit>
</persistence>
那么项目怎么能找不到文件,该文件有效并且我没有更改文件夹或文件名......或任何可能与路径有关的东西?我只找到了路径错误的答案,但是结构是通过 JPA 创建的并且有效,所以我认为这不应该是问题。
感谢您的帮助,如果语法不太好,我们深表歉意。