Return-Path: X-Original-To: apmail-karaf-user-archive@minotaur.apache.org Delivered-To: apmail-karaf-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CF50110BEC for ; Tue, 14 Jan 2014 13:37:30 +0000 (UTC) Received: (qmail 78446 invoked by uid 500); 14 Jan 2014 13:37:30 -0000 Delivered-To: apmail-karaf-user-archive@karaf.apache.org Received: (qmail 78382 invoked by uid 500); 14 Jan 2014 13:37:29 -0000 Mailing-List: contact user-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@karaf.apache.org Delivered-To: mailing list user@karaf.apache.org Received: (qmail 78374 invoked by uid 99); 14 Jan 2014 13:37:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jan 2014 13:37:29 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [81.80.239.197] (HELO mgw02.sopragroup.com) (81.80.239.197) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jan 2014 13:37:22 +0000 Received: from mgw02.sopragroup.com (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 775F3183C55 for ; Tue, 14 Jan 2014 14:37:01 +0100 (CET) From: Dutertry Nicolas To: "'user@karaf.apache.org'" Subject: RE: JPA with Karaf Thread-Topic: JPA with Karaf Thread-Index: Ac8RC07ufr2FX4WhSDeAtAzvCswQ+gABEfqAAACLLYAAABi9gAAGvYAA Date: Tue, 14 Jan 2014 13:36:59 +0000 Message-ID: <968_1389706621_52D53D7D_968_5961_1_56DC7FCE734E5943A64836578350F5239BE7F8@wptxexmbx04.ptx.fr.sopra> References: <27807_1389692013_52D5046D_27807_2111_1_56DC7FCE734E5943A64836578350F5239BE27D@wptxexmbx04.ptx.fr.sopra> <52D51907.20007@nanthrax.net> In-Reply-To: Accept-Language: fr-FR, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.166.70.29] Content-Type: multipart/alternative; boundary="_000_56DC7FCE734E5943A64836578350F5239BE7F8wptxexmbx04ptxfrs_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_56DC7FCE734E5943A64836578350F5239BE7F8wptxexmbx04ptxfrs_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Thank you Achim, the feature with openjpa 2.2.2 you gave me works ! I'm wondering why Karaf 3.0.0 provide an openjpa feature if it does not wor= k ? Regards -- Nicolas Dutertry From: Achim Nierbeck [mailto:bcanhome@googlemail.com] Sent: mardi 14 janvier 2014 12:20 To: user@karaf.apache.org Subject: Re: JPA with Karaf btw. this is a working feature, I used in a sample with Karaf 3.0 transaction jpa jndi mvn:org.apache.geronimo.specs/geronimo-annotation_1.0_spec/1.1.1 mvn:org.apache.geronimo.specs/geronimo-jpa_2.0_spec/1.1 mvn:org.apache.geronimo.specs/geronimo-servlet_2.5_spec/1.2 mvn:org.apache.geronimo.specs/geronimo-el_1.0_spec/1.0.1 mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1 mvn:commons-lang/commons-lang/2.6 mvn:commons-collections/commons-collections/3.2.1 mvn:commons-pool/commons-pool/1.6 mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.com= mons-dbcp/1.4_3 mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.ant= /1.7.0_6 mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.ser= p/1.14.1_1 mvn:org.apache.geronimo.specs/geronimo-jms_1.1_spec/1.1.1 mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.asm= /3.3_2 mvn:org.apache.openjpa/openjpa/2.2.2 2014/1/14 Achim Nierbeck > Yes I'm able to confirm, the openjpa 2.3.0 feature does have an issue. If you take a look at how the openjpa requirements for 2.2.0 are defined in= camel you'll find a working sample :) regards, Achim 2014/1/14 Jean-Baptiste Onofr=E9 > Hi Nicolas, could you try with OpenJPA 2.2.2 ? AFAIR it seems OpenJPA 2.3.0 has an issu= e. Regards JB On 01/14/2014 10:33 AM, Dutertry Nicolas wrote: Hi, I am trying to use JPA with Karaf 3.0.0 but it does not work. First of all I have installed the following features : karaf@root()> feature:install jndi jpa transaction openjpa Then I have created a simple JPA bundle containing: -A HSQLDB datasource configured with blueprint -A JPA entity (class Person) and the file META-INF/persistence.xml -A service for getting and creating people (class PersonService) The JPA EntityManager is injected in PersonService using blueprint. Finally I have deployed hsqldb and my bundle in Karaf, but my bundle's state is set to "GracePeriod" : karaf@root()> list START LEVEL 100 , List Threshold: 50 ID | State | Lvl | Version | Name ---------------------------------------------------------------------------= ---------------------- 86 | Active | 80 | 3.0.0 | Apache Karaf :: JNDI :: Command 114 | Active | 80 | 2.3.0 | Apache ServiceMix :: Specs :: Java Persistence API 1.4 115 | Active | 80 | 3.2.1 | Commons Collections 116 | Active | 80 | 1.6.0 | Commons Pool 117 | Active | 80 | 1.4 | Commons DBCP 118 | Active | 80 | 2.6 | Commons Lang 119 | Active | 80 | 2.3.0 | OpenJPA Aggregate Jar 120 | Active | 80 | 2.3.1 | HSQLDB 121 | GracePeriod | 80 | 1.0.0.SNAPSHOT | Test JPA OSGi Bundle In the log file we found : 2014-01-14 10:04:28,388 | INFO | raf-3.0.0/deploy | BlueprintContainerImpl | 4 - org.apache.aries.blueprint.core - 1.3.0 | Bundle test.jpa is waiting for dependencies [(&(&(org.apache.aries.jpa.proxy.factory=3Dtrue)(osgi.unit.name=3Dtest))(objectClass=3Djavax.persistence.EntityManagerFactory))= ] I have attached the sources of my bundle and the full karaf log file in this mail. Is there a bug in Karaf or am I missing something ? Thanks for your help. -- Nicolas Dutertry HR Access - http://www.hraccess.com -- Jean-Baptiste Onofr=E9 jbonofre@apache.org http://blog.nanthrax.net Talend - http://www.talend.com -- Apache Karaf Committer & PMC OPS4J Pax Web Committer & P= roject Lead OPS4J Pax for Vaadin Co= mmiter & Project Lead blog -- Apache Karaf Committer & PMC OPS4J Pax Web Committer & P= roject Lead OPS4J Pax for Vaadin Co= mmiter & Project Lead blog --_000_56DC7FCE734E5943A64836578350F5239BE7F8wptxexmbx04ptxfrs_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Thank you Achim, the feat= ure with openjpa 2.2.2 you gave me works !

 <= /p>

I’m wondering why K= araf 3.0.0 provide an openjpa feature if it does not work ?

 <= /p>

Regards=

--
Nicolas Dutertry

From: Achim Ni= erbeck [mailto:bcanhome@googlemail.com]
Sent: mardi 14 janvier 2014 12:20
To: user@karaf.apache.org
Subject: Re: JPA with Karaf

 

btw. 

 

this is a working feature, I used in a sample with K= araf 3.0

 

<feature name=3D'Karaf-JPA-OpenJPA' version=3D'${project.versio= n}'>

    <!-- Container dependencies -->

        <feature>transaction</feature= >

        <feature>jpa</feature>

        <feature>jndi</feature>

        

        <!-- Dependencies for OpenJPA -->= ;

<bundle>mvn:org.apache.geronimo.specs/geronimo-annotation_1.= 0_spec/1.1.1</bundle>

<bundle>mvn:org.apache.geronimo.specs/geronimo-jpa_2.0_spec/= 1.1</bundle>

<bundle>mvn:org.apache.geronimo.specs/geronimo-servlet_2.5_s= pec/1.2</bundle>

<bundle>mvn:org.apache.geronimo.specs/geronimo-el_1.0_spec/1= .0.1</bundle>

<bundle>mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/= 1.1.1</bundle>

<bundle>mvn:commons-lang/commons-lang/2.6</bundle>

<bundle>mvn:commons-collections/commons-collections/3.2.1<= ;/bundle>

<bundle>mvn:commons-pool/commons-pool/1.6</bundle>

<bundle>mvn:org.apache.servicemix.bundles/org.apache.service= mix.bundles.commons-dbcp/1.4_3</bundle>

<bundle>mvn:org.apache.servicemix.bundles/org.apache.service= mix.bundles.ant/1.7.0_6</bundle>

<bundle>mvn:org.apache.servicemix.bundles/org.apache.service= mix.bundles.serp/1.14.1_1</bundle>

<bundle>mvn:org.apache.geronimo.specs/geronimo-jms_1.1_spec/= 1.1.1</bundle>

<bundle>mvn:org.apache.servicemix.bundles/org.apache.service= mix.bundles.asm/3.3_2</bundle>

<bundle>mvn:org.apache.openjpa/openjpa/2.2.2</bundle><= o:p>

</feature>

 

2014/1/14 Achim Nierbeck <bcanhome@googlemail.com><= /o:p>

Yes I'm able to confirm, the openjpa 2.3.0 feature d= oes have an issue. 

If you take a look at how the openjpa requirements f= or 2.2.0 are defined in camel

you'll find a working sample :)

 

regards, Achim 

 

2014/1/14 Jean-Baptiste Onofr=E9 <jb@nanthrax.net>

Hi Nicolas,

could you try with OpenJPA 2.2.2 ? AFAIR it seems OpenJPA 2.3.0 has an issu= e.

Regards
JB



On 01/14/2014 10:33 AM, Dutertry Nicolas wrote:

Hi,

I am trying to use JPA with Karaf 3.0.0 but it does not work.

First of all I have installed the following features :

karaf@root()> feature:install jndi jpa transaction openjpa

Then I have created a simple JPA bundle containing:

-A HSQLDB datasource configured with blueprint

-A JPA entity (class Person) and the file META-INF/persistence.xml

-A service for getting and creating people (class PersonService)=



The JPA EntityManager is injected in PersonService using blueprint.

Finally I have deployed hsqldb and my bundle in Karaf, but my bundle’= s
state is set to “GracePeriod” :

karaf@root()> list

START LEVEL 100 , List Threshold: 50

ID | State       | Lvl | Version        = | Name

---------------------------------------------------------------------------= ----------------------

86 | Active      |  80 | 3.0.0       &nb= sp;  | Apache Karaf :: JNDI :: Command

114 | Active      |  80 | 2.3.0       &n= bsp;  | Apache ServiceMix :: Specs ::
Java Persistence API 1.4

115 | Active      |  80 | 3.2.1       &n= bsp;  | Commons Collections

116 | Active      |  80 | 1.6.0       &n= bsp;  | Commons Pool

117 | Active      |  80 | 1.4       &nbs= p;    | Commons DBCP

118 | Active      |  80 | 2.6       &nbs= p;    | Commons Lang

119 | Active      |  80 | 2.3.0       &n= bsp;  | OpenJPA Aggregate Jar

120 | Active      |  80 | 2.3.1       &n= bsp;  | HSQLDB

121 | GracePeriod |  80 | 1.0.0.SNAPSHOT | Test JPA OSGi Bundle

In the log file we found :

2014-01-14 10:04:28,388 | INFO  | raf-3.0.0/deploy |
BlueprintContainerImpl           | 4 - org.apache.= aries.blueprint.core -
1.3.0 | Bundle test.jpa is waiting for dependencies
[(&(&(org.apache.aries.jpa.proxy.factory=3Dtrue)(osgi.unit.name=3Dtest))(objectClass= =3Djavax.persistence.EntityManagerFactory))]

I have attached the sources of my bundle and the full karaf log file in
this mail.

Is there a bug in Karaf or am I missing something ?

Thanks for your help.

--
Nicolas Dutertry
HR Access - http://ww= w.hraccess.com


--
Jean-Baptiste Onofr=E9
jbonofre@apache.or= g
http://blog.nanthrax= .net
Talend - http://www.tal= end.com



 

--

Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display= /paxweb/Pax+Web/> Committer & Project Lead
OPS4J Pax for Vaadin <http://team.ops4j.org/= wiki/display/PAXVAADIN/Home> Commiter & Project Lead
blog <http://notizblog.nierbeck.de/>



 

--

Apache Karaf <htt= p://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead
OPS4J Pax for Vaadin <
http://team.ops4j.org/wiki/display/PAXVAADIN/= Home> Commiter & Project Lead
blog <http:/= /notizblog.nierbeck.de/>

--_000_56DC7FCE734E5943A64836578350F5239BE7F8wptxexmbx04ptxfrs_--