Does anybody know a good, simple step by step tutorial on how to quickly start using JPA 2.1 with Karaf 4.1.3? At this point I am not requiring any specific JPA implementation/version (Hibernate vs. any other). So far using Karaf’s default has not worked for me. I would expect Karaf’s defaults should work out our the box.
> On Nov 20, 2017, at 2:54 PM, Jean-Baptiste Onofré <j...@nanthrax.net> wrote: > > Ok, I see hibernate now. Let me check if I see the jpa spec bundle. > > Regards > JB > On Nov 20, 2017, at 20:42, Alex Soto <alex.s...@envieta.com > <mailto:alex.s...@envieta.com>> wrote: > Thank you JB for the quick response. > OK, so I installed the jpa feature: > > feature:install jpa > > karaf@root()> list > START LEVEL 100 , List Threshold: 50 > ID │ State │ Lvl │ Version │ Name > ────┼───────────┼─────┼────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── > 28 │ Active │ 80 │ 4.1.3 │ Apache Karaf :: OSGi Services :: > Event > 52 │ Active │ 80 │ 1.3.0 │ ClassMate > 53 │ Active │ 80 │ 3.20.0.GA │ Javassist > 54 │ Active │ 80 │ 1.2 │ javax.interceptor API > 55 │ Active │ 80 │ 1.6.6 │ Byte Buddy (without dependencies) > 56 │ Active │ 80 │ 2.7.7.5 │ Apache ServiceMix :: Bundles :: > antlr > 57 │ Active │ 80 │ 1.6.1.5 │ Apache ServiceMix :: Bundles :: > dom4j > 58 │ Active │ 80 │ 5.0.1.Final │ hibernate-commons-annotations > 59 │ Active │ 80 │ 5.2.8.Final │ hibernate-core > 60 │ Active │ 80 │ 1.0.0.Final │ hibernate-jpa-2.1-api > 61 │ Active │ 80 │ 5.2.8.Final │ hibernate-osgi > 62 │ Active │ 80 │ 2.0.3.Final │ Java Annotation Indexer > 63 │ Active │ 80 │ 3.3.0.Final │ JBoss Logging 3 > 65 │ Active │ 80 │ 1.9.2.1 │ Apache ServiceMix :: Bundles :: > jasypt > 66 │ Active │ 80 │ 1.1.0 │ OPS4J Pax JDBC Config > 67 │ Active │ 80 │ 1.1.0 │ OPS4J Pax JDBC Pooling Support > Base > 68 │ Active │ 80 │ 1.0.0.201505202023 │ org.osgi:org.osgi.service.jdbc > 69 │ Active │ 80 │ 1.3.172 │ H2 Database Engine > 117 │ Active │ 80 │ 1.2.0 │ CDI APIs > 118 │ Active │ 80 │ 1.2 │ javax.transaction API > 119 │ Active │ 80 │ 1.1.1 │ Apache Aries Transaction > Blueprint > 120 │ Active │ 80 │ 2.1.0 │ Apache Aries Transaction > Blueprint > 121 │ Active │ 80 │ 1.3.3 │ Apache Aries Transaction Manager > 122 │ Active │ 80 │ 1.0.2 │ Apache Felix Coordinator Service > 123 │ Active │ 80 │ 1.0.0.2 │ Apache ServiceMix :: Bundles :: > javax.inject > 124 │ Installed │ 80 │ 2.7.0.SNAPSHOT │ Apache Aries JPA example > tasklist model > 125 │ Active │ 80 │ 2.6.1 │ Apache Aries JPA Container API > 126 │ Active │ 80 │ 2.6.1 │ Apache Aries JPA blueprint > 127 │ Active │ 80 │ 2.6.1 │ Apache Aries JPA container > 128 │ Active │ 80 │ 2.6.1 │ Apache Aries JPA support > 129 │ Active │ 80 │ 1.1.1 │ geronimo-jms_1.1_spec > 130 │ Active │ 80 │ 1.7.0.6 │ Apache ServiceMix :: Bundles :: > antThe same problem persists > > And > > karaf@root()> bundle:diag 124 > Apache Aries JPA example tasklist model (124) > --------------------------------------------- > Status: Installed > Unsatisfied Requirements: > [org.apache.aries.jpa.example.tasklist.model [124](R 124.0)] osgi.service; > (osgi.jndi.service.name=tasklist) > [org.apache.aries.jpa.example.tasklist.model [124](R 124.0)] osgi.contract; > (&(osgi.contract=JavaJPA)(version=2.1.0)) > Declarative Services > > > Or is it something else I need to install? > > Best regards, > > Alex soto > alex.s...@envieta.com <mailto:alex.s...@envieta.com> > > > >> On Nov 20, 2017, at 2:31 PM, Jean-Baptiste Onofré < j...@nanthrax.net >> <mailto:j...@nanthrax.net>> wrote: >> >> I don't see the jpa engine in your bundle list ? Openjpa, hibernate, >> eclipselink ? >> The jpa version depends of the engine. >> >> Regards >> JB >> On Nov 20, 2017, at 20:09, Alex Soto < alex.s...@envieta.com >> <mailto:alex.s...@envieta.com>> wrote: >> Hello, >> >> This is my first attempt to use JPA with Karaf, so I am trying to follow >> example from https://github.com/apache/aries-jpa >> <https://github.com/apache/aries-jpa> using Karaf 4.1.3, so far >> unsuccessfully. >> On a clean Karaf I have installed the following: >> >> feature:install hibernate-orm >> feature:install pax-jdbc-config >> feature:install pax-jdbc-h2 >> feature:install http-whiteboard >> feature:install scr >> feature:install transaction >> >> Then I copied the data source config file org.ops4j.datasource-tasklist.cfg >> to the Karaf’s etc directory. >> >> Now, when I install the first Example bundle: >> >> install -s >> mvn:org.apache.aries.jpa.example/org.apache.aries.jpa.example.tasklist.model/2.7.0-SNAPSHOT >> Error executing command: Error installing bundles: >> Unable to start bundle >> mvn:org.apache.aries.jpa.example/org.apache.aries.jpa.example.tasklist.model/2.7.0-SNAPSHOT: >> org.osgi.framework.BundleException: Unable to resolve >> org.apache.aries.jpa.example.tasklist.model [124](R 124.0): missing >> requirement [org.apache.aries.jpa.example.tasklist.model [124](R 124.0)] >> osgi.contract; (&(osgi.contract=JavaJPA)(version=2.1.0)) Unresolved >> requirements: [[org.apache.aries.jpa.example.tasklist.model [124](R 124.0)] >> osgi.contract; (&(osgi.contract=JavaJPA)(version=2.1.0))] >> >> list >> START LEVEL 100 , List Threshold: 50 >> ID │ State │ Lvl │ Version │ Name >> ────┼────────┼─────┼────────────────────┼─────────────────────────────────────────── >> 28 │ Active │ 80 │ 4.1.3 │ Apache Karaf :: OSGi Services :: >> Event >> 52 │ Active │ 80 │ 1.3.0 │ ClassMate >> 53 │ Active │ 80 │ 3.20.0.GA │ Javassist >> 54 │ Active │ 80 │ 1.2 │ javax.interceptor API >> 55 │ Active │ 80 │ 1.6.6 │ Byte Buddy (without dependencies) >> 56 │ Active │ 80 │ 2.7.7.5 │ Apache ServiceMix :: Bundles :: >> antlr >> 57 │ Active │ 80 │ 1.6.1.5 │ Apache ServiceMix :: Bundles :: >> dom4j >> 58 │ Active │ 80 │ 5.0.1.Final │ hibernate-commons-annotations >> 59 │ Active │ 80 │ 5.2.8.Final │ hibernate-core >> 60 │ Active │ 80 │ 1.0.0.Final │ hibernate-jpa-2.1-api >> 61 │ Active │ 80 │ 5.2.8.Final │ hibernate-osgi >> 62 │ Active │ 80 │ 2.0.3.Final │ Java Annotation Indexer >> 63 │ Active │ 80 │ 3.3.0.Final │ JBoss Logging 3 >> 65 │ Active │ 80 │ 1.9.2.1 │ Apache ServiceMix :: Bundles :: >> jasypt >> 66 │ Active │ 80 │ 1.1.0 │ OPS4J Pax JDBC Config >> 67 │ Active │ 80 │ 1.1.0 │ OPS4J Pax JDBC Pooling Support Base >> 68 │ Active │ 80 │ 1.0.0.201505202023 │ org.osgi:org.osgi.service.jdbc >> 69 │ Active │ 80 │ 1.3.172 │ H2 Database Engine >> 117 │ Active │ 80 │ 1.2.0 │ CDI APIs >> 118 │ Active │ 80 │ 1.2 │ javax.transaction API >> 119 │ Active │ 80 │ 1.1.1 │ Apache Aries Transaction Blueprint >> 120 │ Active │ 80 │ 2.1.0 │ Apache Aries Transaction Blueprint >> 121 │ Active │ 80 │ 1.3.3 │ Apache Aries Transaction Manager >> 122 │ Active │ 80 │ 1.0.2 │ Apache Felix Coordinator Service >> 123 │ Active │ 80 │ 1.0.0.2 │ Apache ServiceMix :: Bundles :: >> javax.injec >> >> bundle:diag 124 >> Unsatisfied Requirements: >> [org.apache.aries.jpa.example.tasklist.model [124](R 124.0)] osgi.service; >> (osgi.jndi.service.name=tasklist) >> [org.apache.aries.jpa.example.tasklist.model [124](R 124.0)] osgi.contract; >> (&(osgi.contract=JavaJPA)(version=2.1.0)) >> >> >> Any idea how to troubleshoot this problem? >> >> Best regards, >> Alex soto >> >> >> >