Hello, I am trying to use Karaf with OpenJPA and Derby (Embedded). However my module state is always "GracePeriod". The sample I am trying to deploy is available here:
https://github.com/jgoodyear/ApacheKarafCookbook/tree/master/chapter7/chapter7-recipe4 I build the example with maven. I then open Karaf (please note I tried these steps with both apache-karaf-3.0.5 and apache-karaf-4.0.4). I then install the following features as explained in the book "Apache Karaf Cookbook": feature:install jpa feature:install openjpa/2.2.2 feature:install transaction install -s mvn:org.apache.derby/derbyclient/10.8.1.2 feature:install jndi (Note: for Karaf 4.0.4 I removed versions so latest is installed but when I try an install transaction I got java.lang.ClassNotFoundException: javax.transaction.SystemException not found by org.apache.openjpa so reverted to use 3.0.5!) Here I check and everything is nice and state is "Active". I then follow the last step, to deploy the compiled code: install -s mvn:com.packt/jpa-only/1.0.0-SNAPSHOT I check the state and "jpa-only" bundle is in state "GracePeriod" When I look in the logs I see the following error: [error] JPA-Only Demo Bundle starting... 2016-01-24 19:30:03,662 | INFO | l for user karaf | BlueprintContainerImpl | 15 - org.apache.aries.blueprint.core - 1.4.4 | Bundle jpa-only/1.0.0.SNAPSHOT is waiting for dependencies [(&(&(!(org.apache.aries.jpa.proxy.factory=*))(osgi.unit.name=recipe))(objectClass=javax.persistence.EntityManagerFactory))] 2016-01-24 19:30:03,678 | WARN | l for user karaf | container | 70 - org.apache.aries.jpa.container - 1.0.2 | There are no providers available. Bundle ID: 95 [/error] I have searched all over the Internet to find a solution but nothing seems to work. I found the following which suggest that the is related to Aries JPA update. https://issues.apache.org/jira/browse/KARAF-3244 However if I try "feature:install jpa/1.0.1" as suggested I get "Can't install feature jpa/1.0.1". I found this: http://www.liquid-reality.de/display/liquid/2012/01/13/Apache+Karaf+Tutorial+Part+6+-+Database+Access This does not really suite me because it makes use of Hibernate not OpenJPA. However I tried it all the same. On a clean install of 3.0.5 I run the following: feature:install jdbc feature:repo-add mvn:org.ops4j.pax.jdbc/pax-jdbc-features/0.5.0/xml/features feature:install transaction jndi pax-jdbc-h2 pax-jdbc-config pax-jdbc-pool-dbcp2 jpa/2.1.0 hibernate/4.3.6.Final install -s mvn:net.lr.tutorial.karaf.db/db-examplejpa/1.0-SNAPSHOT This works. However on 4.0.4 I get the "GracePeriod" message as well. I wonder if anyone has a working Karaf + OpenJPA + Derby (Embedded) example? That would really help me out. I would like to use latest version of all but I read that Blueprint XML is no longer supported. -- View this message in context: http://karaf.922171.n3.nabble.com/How-to-solve-bundle-state-GracePeriod-tp4044982.html Sent from the Karaf - User mailing list archive at Nabble.com.
