Hi,

dear Jean-Baptiste Onofré. I am talking about this repository. It does not
work.

I've checked out https://github.com/jbonofre/karaf/tree/DEV_GUIDE

$ git clone -b DEV_GUIDE https://github.com/jbonofre/karaf/tree/DEV_GUIDE
karaf_dev_guide

Build it with maven:

$ mvn -DskipTests -Pfastinstall clean install

Went to the distribution/assembly:

$ cd assemblies/apache-karaf/target/assembly/

and started Karaf from here:

$ JAVA_HOME=/opt/jdk ./bin/karaf debug
Listening for transport dt_socket at address: 5005
        __ __                  ____
       / //_/____ __________ _/ __/
      / ,<  / __ `/ ___/ __ `/ /_
     / /| |/ /_/ / /  / /_/ / __/
    /_/ |_|\__,_/_/   \__,_/_/

  Apache Karaf (4.2.1-SNAPSHOT)

>From here, first and only thing I do is:

karaf@root()> feature:repo-add
mvn:org.apache.karaf.examples/karaf-jpa-example-features/4.2.1-SNAPSHOT/xml
karaf@root()> feature:install
karaf-jpa-example-datasource

karaf@root()> feature:install karaf-jpa-example-provider
org.apache.felix.resolver.reason.ReasonException: Unable to resolve root:
missing requirement [root] osgi.identity;
osgi.identity=karaf-jpa-example-provider; type=karaf.feature;
version="[4.2.1.SNAPSHOT,4.2.1.SNAPSHOT]";
filter:="(&(osgi.identity=karaf-jpa-example-provider)(type=karaf.feature)(version>=4.2.1.SNAPSHOT)(version<=4.2.1.SNAPSHOT))"
[caused by: Unable to resolve karaf-jpa-example-provider/4.2.1.SNAPSHOT:
missing requirement [karaf-jpa-example-provider/4.2.1.SNAPSHOT]
osgi.identity;
osgi.identity=org.apache.karaf.examples.karaf-jpa-example-provider;
type=osgi.bundle; version="[4.2.1.SNAPSHOT,4.2.1.SNAPSHOT]";
resolution:=mandatory [caused by: Unable to resolve
org.apache.karaf.examples.karaf-jpa-example-provider/4.2.1.SNAPSHOT:
missing requirement
[org.apache.karaf.examples.karaf-jpa-example-provider/4.2.1.SNAPSHOT]
osgi.service; objectClass=javax.persistence.spi.PersistenceProvider;
javax.persistence.provider=org.hibernate.jpa.HibernatePersistenceProvider;
effective:=active]]
    at
org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1343)
    at
org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:392)
    at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:378)
    at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:332)
    at
org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
    at
org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:388)
    at
org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1025)
    at
org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:964)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to
resolve karaf-jpa-example-provider/4.2.1.SNAPSHOT: missing requirement
[karaf-jpa-example-provider/4.2.1.SNAPSHOT] osgi.identity;
osgi.identity=org.apache.karaf.examples.karaf-jpa-example-provider;
type=osgi.bundle; version="[4.2.1.SNAPSHOT,4.2.1.SNAPSHOT]";
resolution:=mandatory [caused by: Unable to resolve
org.apache.karaf.examples.karaf-jpa-example-provider/4.2.1.SNAPSHOT:
missing requirement
[org.apache.karaf.examples.karaf-jpa-example-provider/4.2.1.SNAPSHOT]
osgi.service; objectClass=javax.persistence.spi.PersistenceProvider;
javax.persistence.provider=org.hibernate.jpa.HibernatePersistenceProvider;
effective:=active]
    at
org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1343)
    ... 12 more
Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to
resolve
org.apache.karaf.examples.karaf-jpa-example-provider/4.2.1.SNAPSHOT:
missing requirement
[org.apache.karaf.examples.karaf-jpa-example-provider/4.2.1.SNAPSHOT]
osgi.service; objectClass=javax.persistence.spi.PersistenceProvider;
javax.persistence.provider=org.hibernate.jpa.HibernatePersistenceProvider;
effective:=active
    at
org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1343)
    ... 13 more
Error executing command: Unable to resolve root: missing requirement [root]
osgi.identity; osgi.identity=karaf-jpa-example-provider;
type=karaf.feature; version="[4.2.1.SNAPSHOT,4.2.1.SNAPSHOT]";
filter:="(&(osgi.identity=karaf-jpa-example-provider)(type=karaf.feature)(version>=4.2.1.SNAPSHOT)(version<=4.2.1.SNAPSHOT))"
[caused by: Unable to resolve karaf-jpa-example-provider/4.2.1.SNAPSHOT:
missing requirement [karaf-jpa-example-provider/4.2.1.SNAPSHOT]
osgi.identity;
osgi.identity=org.apache.karaf.examples.karaf-jpa-example-provider;
type=osgi.bundle; version="[4.2.1.SNAPSHOT,4.2.1.SNAPSHOT]";
resolution:=mandatory [caused by: Unable to resolve
org.apache.karaf.examples.karaf-jpa-example-provider/4.2.1.SNAPSHOT:
missing requirement
[org.apache.karaf.examples.karaf-jpa-example-provider/4.2.1.SNAPSHOT]
osgi.service; objectClass=javax.persistence.spi.PersistenceProvider;
javax.persistence.provider=org.hibernate.jpa.HibernatePersistenceProvider;
effective:=active]]

This are all the steps described on:
https://github.com/jbonofre/karaf/tree/DEV_GUIDE/examples/karaf-jpa-example

So my question is only: what is not this working? What am I doing wrong -
are there any pre-requirements ?


Kind Regards,
Miroslav



2018-07-20 18:08 GMT+02:00 Jean-Baptiste Onofré <j...@nanthrax.net>:

> Hi,
>
> the examples are for 4.2.x only not 4.1.x.
>
> All versions are contained in the JPA example itself, using hibernate
> provided by Karaf 4.2.1.
>
> Regards
> JB
>
> On 20/07/2018 16:17, Miroslav Beranič wrote:
> > Hi,
> >
> > I've upgraded my environment from ServiceMix 7.1.0-SNAPSHOT ( running
> > Karaf 4.0.9 ) to Karaf 4.1.x ( GitHub ) branch and later on I've
> > experimented with version 4.2.x.
> > I was using linked linkes from Karaf home page (
> > https://karaf.apache.org/documentation.html ) to GitHub Examples - for
> JPA.
> >
> > My main task is to get JPA 2 up and running, but I fail to do so.
> >
> > So on provided examples Github repository:
> > https://github.com/jbonofre/karaf/tree/DEV_GUIDE/examples/
> karaf-jpa-example
> >
> > I've tested with Karaf 4.1.x and 4.2.x and in both version, Examples for
> > JPA do now work - for me.
> >
> > For Karaf 4.2.x I've created PasteBin outputs ( please see ):
> > 1.) https://pastebin.com/eJybVNhn
> > 2.) https://pastebin.com/W2UhihdR
> >
> > In examples, I've noted that there is a reference to Hibernate
> > 6.0.10.Final - this version is not released yet ( hibernate.org
> > <http://hibernate.org> ), so I guess this is a wrong version, or ? as I
> > see Karaf has build-in support for Hibernate 5.2.9.Final.
> >
> > https://github.com/jbonofre/karaf/blob/DEV_GUIDE/examples/
> karaf-jpa-example/karaf-jpa-example-features/src/main/feature/feature.xml
> >
> > For Hibernate version I am looking at:
> > https://github.com/apache/karaf/blob/master/pom.xml
> > <hibernate.version>5.2.9.Final</hibernate.version>
> >
> > So what I did was:
> >
> > 1.) checked out Karaf 4.1.x from Github
> > 2.) checked out Karaf Examples ( DEV_GUIDE branch from Github )
> >
> > 3.) Build Karaf with Maven: mvn -Pfastinstall and started Karaf with
> > ./bin/karaf debug
> > 4.) Build Karaf Examples ( changed version of Hibernate from
> > 6.0.10.Final to 5.2.9.Final )
> >
> > Read instruction from:
> > https://github.com/jbonofre/karaf/blob/DEV_GUIDE/examples/
> karaf-jpa-example/README.md
> >
> > 5.) feature:repo-add
> > mvn:org.apache.karaf.examples/karaf-jpa-example-features/4.
> 2.1-SNAPSHOT/xml
> > 6.) feature:install karaf-jpa-example-datasource
> > 7.) feature:install karaf-jpa-example-provider
> >
> > Fail:
> >
> > Error executing command: Unable to resolve root: missing requirement
> > [root] osgi.identity; osgi.identity=karaf-jpa-example-provider;
> > type=karaf.feature; version="[4.2.1.SNAPSHOT,4.2.1.SNAPSHOT]";
> > filter:="(&(osgi.identity=karaf-jpa-example-provider)(
> type=karaf.feature)(version>=4.2.1.SNAPSHOT)(version<=4.2.1.SNAPSHOT))"
> > [caused by: Unable to resolve karaf-jpa-example-provider/4.2.1.SNAPSHOT:
> > missing requirement [karaf-jpa-example-provider/4.2.1.SNAPSHOT]
> > osgi.identity;
> > osgi.identity=org.apache.karaf.examples.karaf-jpa-example-provider;
> > type=osgi.bundle; version="[4.2.1.SNAPSHOT,4.2.1.SNAPSHOT]";
> > resolution:=mandatory [caused by: Unable to resolve
> > org.apache.karaf.examples.karaf-jpa-example-provider/4.2.1.SNAPSHOT:
> > missing requirement
> > [org.apache.karaf.examples.karaf-jpa-example-provider/4.2.1.SNAPSHOT]
> > osgi.service; objectClass=javax.persistence.spi.PersistenceProvider;
> > javax.persistence.provider=org.hibernate.jpa.
> HibernatePersistenceProvider;
> > effective:=active]]
> >
> > I am using Linux x64, Oracle Java 8 172 x64.
> >
> > What I am doing wrong. I've mixed different version of Hibernate, Karaf,
> > ... and noting. Always some more or less strange error.
> >
> > Plus there is an issue: what version of maven-bundle-plugin should/must
> > be used? I've tried 3.01 and 3.2.0. When I use 3.0.1 I have to update
> > <Import-Package> if I use 3.2.0 I get error that javassist is not
> resolved:
> >
> > Error executing command: Unable to resolve root: missing requirement
> > [root] osgi.identity; osgi.identity=. ... osgi.wiring.package;
> > filter:="(&(osgi.wiring.package=javassist.util.proxy)(
> version>=3.22.0)(!(version>=4.0.0)))"]]]
> >
> >
> >
> > So all in all I can not and did not find and singe point of truth what
> > is valid example or way of doing JPA 2 with Hibernate. I guess I am
> > doing something wrong as all examples make it so simple but ... no luck.
> > All I did is clean ( new computer - virtual ) checkout from git, build
> > and deploy - and fail.
> >
> > I would like to migrate existing code using JPA 1 to JPA 2 ( 2.2 ? ) but
> > ... this is difficult task to complete ( this is after one week of pain
> > and frustration ).
> >
> > I've done examples from https://github.com/cschneider/Karaf-Tutorial
> > also, but no luck. More-or-less same problems.
> >
> >
> > 1.) What versions of Maven plugins should I use?
> > 2.) What versions of JPA?
> > 3.) What versions of Hibernate?
> > 4.) What example should I follow ( URL / Git and branch ) ?
> >
> >
> > This are my top questions.
> >
> >
> > Kind Regards,
> > Miroslav
> >
> >
> >
> > --
> > Miroslav Beranič
> > MIBESIS
> > +386(0)40/814-843
> > miroslav.bera...@mibesis.si <mailto:miroslav.bera...@mibesis.si>
> > http://www.mibesis.si
>



-- 
Miroslav Beranič
MIBESIS
+386(0)40/814-843
miroslav.bera...@mibesis.si
http://www.mibesis.si

Reply via email to