Using EclipseLink JPA in OSGI (Karaf) -


i using eclipselink jpa implementation(in karaf).and following jars used:-

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 

my 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 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> 

but gemini.dbaccess.derby_1.0.0.m1-incubation jar remians in installed state gemini.jpa.weaving jar remains in resolved state.

restarting gemini.dbaccess.derby_1.0.0.m1-incubation gives following error:-

reason: missing constraint: import-package: org.apache.derby.client.am; version="0.0.0" 

and application gives following error:-

could not find data source factory in registry: org.apache.derby.jdbc.clientdriver 

i new using eclipselink in osgi ,what missing here ?

apache karaf 4.0.0 has been released,this version of karaf provides eclipselink support.

feature:install eclipselink 

therefore there no need use external adapters using eclipselink


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -