我在EclipseLink中遇到了一些问题。我使用的是GlassFish v3.1,我正在尝试为我的持久层使用EclipseLink。我遵循Eclipse wiki上提供的所有教程,但没有幸运。我的persistence.xml文件不能被解析,我收到此错误,而试图创建的EntityManagerFactory:将EclipseLink导入OSGI包persistence.xml未找到
org.eclipse.persistence.exceptions.PersistenceUnitLoadingException 异常说明:从URL处理persistence.xml中引发异常:束://307.1:1/
这是我的persistence.xml位于/ WEB-INF /类/ META-INF /:
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="generic">
<class>com.generic.domain.Service</class>
<properties>
<!-- Embedded MySQL Login -->
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306"/>
<!-- TODO: replace with connection pool -->
<property name="javax.persistence.jdbc.userid" value="root"/>
<property name="javax.persistence.jdbc.password" value=""/>
<property name="eclipselink.target-database" value="MySQL"/>
<property name="eclipselink.jdbc.read-connections.min" value="1"/>
<property name="eclipselink.jdbc.write-connections.min" value="1"/>
<property name="eclipselink.jdbc.batch-writing" value="JDBC"/>
<!-- Logging Settings -->
<property name="eclipselink.logging.level" value="FINE" />
<property name="eclipselink.logging.thread" value="false" />
<property name="eclipselink.logging.session" value="false" />
<property name="eclipselink.logging.exceptions" value="true" />
<property name="eclipselink.logging.timestamp" value="false"/>
</properties>
</persistence-unit>
</persistence>
我加入这一行到我的清单。 MF:
JPA-PersistenceUnits: generic
1)true 2)我正在使用GlassFish v3.1中提供的EclipseLink捆绑包3)堆栈跟踪:http://dinoz.mobi/stack.txt – MobileSam 2011-02-01 13:55:18
1.您可以告诉你的WAB? 2.你可以告诉WAB的Bundle-ClassPath吗? – Sahoo 2011-02-02 19:29:23