我使用的EclipseLink作爲我JPA實現(KARAF)。而下面的罐被使用: -在OSGI使用的EclipseLink JPA(Karaf)
install -s mvn:org.eclipse.persistence/org.eclipse.persistence.antlr/2.5.0
install -s mvn:org.eclipse.persistence/org.eclipse.persistence.asm/2.5.0
install -s mvn:org.eclipse.persistence/org.eclipse.persistence.core/2.5.0
install -s mvn:org.apache.geronimo.specs/geronimo-jpa_2.0_spec/1.1
install -s mvn:org.osgi/org.osgi.compendium/4.2.0
install -s mvn:org.osgi/org.osgi.enterprise/4.2.0
org.eclipse.gemini.dbaccess.derby_1.0.0.M1-incubation.jar
org.eclipse.gemini.jpa.weaving_1.0.0.RC1.jar
org.eclipse.gemini.jpa_1.0.0.RC1.jar
我persistence.xml
是: -
<?xml version="1.0" encoding="UTF-8"?>
<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="resource" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<class>myPkg.entity.Resource</class>
<properties>
<property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.EmbeddedDriver"
/> <property name="javax.persistence.jdbc.url" value="jdbc:derby:DB;create=true"
/>
<!-- <property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.ClientDriver" />
<property name="javax.persistence.jdbc.url" value="jdbc:derby://localhost:1527/D:\DB;create=true" /> -->
<property name="javax.persistence.jdbc.user" value="test" />
<property name="javax.persistence.jdbc.password" value="test" />
<property name="eclipselink.logging.level" value="OFF" />
<!-- EclipseLink should create the database schema automatically -->
<property name="eclipselink.ddl-generation" value="create-tables" />
<property name="eclipselink.ddl-generation.output-mode"
value="database" />
<property name="connection.autocommit" value="false" />
<property name="eclipselink.persistence-context.flush-mode" value="commit" />
<!-- <property name="eclipselink.allow-zero-id" value="true"/> -->
</properties>
</persistence-unit>
</persistence>
但是Installed狀態下的gemini.dbaccess.derby_1.0.0.M1-incubation
jar Remians以及gemini.jpa.weaving jar
仍處於已解決狀態。
重新啓動gemini.dbaccess.derby_1.0.0.M1-incubation
提供了以下錯誤: -
Reason: Missing Constraint: Import-Package: org.apache.derby.client.am; version="0.0.0"
而且我的應用程序提供了以下錯誤: -
Could not find data source factory in registry: org.apache.derby.jdbc.ClientDriver
我是新來的OSGI使用的EclipseLink,我在這裏失蹤?
什麼庫有eclipseLink功能? –
功能:install命令區分大小寫 - 功能:安裝eclipselink –