RE: JPA with Karaf

2014-05-26 Thread Ephemeris Lappis
Hello.

I'm testing Hibernate on ServiceMix, and I have similar problems.
I've tried using the Hibernate 4.2.7 that comes with ServiceMix 5.0.1, but
as it did work, I've built a simple feature with the 4.2.12.
I had the same error that you described about the the EntityManagerFactory,
and stopping the Hibernate-OSGi bundle before I deploy my bundles seemed to
resolve the issue.
Thanks for the trick !
But when I test it all, I have now a problem with the transaction that seems
no to be commited at the end of my service call, and, therefore, the
persisted entities are not really inserted into the database. I use the
tx:transaction declaration in the service blueprint, but it doesn't work.
Did you experience such problems ?
Thanks.
Regards.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/JPA-with-Karaf-tp4031000p4033281.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: JPA with Karaf

2014-01-15 Thread Jean-Baptiste Onofré
It's what I did in the hibernate features provided by Karaf: the 
start-level should be greater than the default one.


Regards
JB

On 01/16/2014 08:33 AM, Christoph Gritschenberger wrote:

Setting the start-level of hibernate-osgi to 100 (higher than all the
other bundles) worked for me

kind regards,
Christoph


On 2014-01-15 16:13, Dutertry Nicolas wrote:

I used version 3.3.2.GA available in Karaf 3.0.0.

I have also tested version 4.2.7 found here :
https://github.com/lburgazzoli/lb-karaf-features/blob/master/repo/hibernate4.xml


I have finally managed to make this version work. Indeed I found in a
hibernate tutorial (see last comment in
https://github.com/hibernate/hibernate-orm/blob/4.2/documentation/src/main/docbook/quickstart/tutorials/osgi/managed-jpa/features.xml)
that hibernate-osgi must be started after the bundle containing JPA
entities.
So to make everything work,  I have to stop the "hibernate-osgi"
bundle before installing my bundle, and then restart "hibernate-osgi".
For instance :

feature:install hibernate42
stop 127 // NB: 127 is hibernate-osgi bundle
install url_to_my_bundle
start 127


This is somewhat dirty, I hope we can find a better solution.

Regards,
--
Nicolas

-Original Message-
From: Jean-Baptiste Onofré [mailto:j...@nanthrax.net]
Sent: mercredi 15 janvier 2014 15:02
To: user@karaf.apache.org
Subject: Re: JPA with Karaf

Hi Nicolas,

thanks for the update.

What's version of the hibernate feature do you use ?

Regards
JB

On 01/15/2014 02:53 PM, Dutertry Nicolas wrote:

The "hibernate" feature seems to be broken as well. I tried it and
got a "GracePeriod" state with the same log message :
Bundle test.jpa is waiting for dependencies
[(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=test))(o
bjectClass=javax.persistence.EntityManagerFactory))]

Regards
--
Nicolas
-Original Message-
From: Jean-Baptiste Onofré [mailto:j...@nanthrax.net]
Sent: mercredi 15 janvier 2014 06:46
To: user@karaf.apache.org
Subject: Re: JPA with Karaf

By the way, reviewing the OpenJPA feature, we found that the problem
is in the feature itself. We fix both OpenJPA 2.2.2 and 2.3.0
features for the next Karaf release.

Sorry about that.

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=true)(osgi.unit.name=test))(
o bjectClass=javax.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é
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com



--
Jean-Baptiste Onofré
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com






--
Jean-Baptiste Onofré
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com


Re: JPA with Karaf

2014-01-15 Thread Christoph Gritschenberger
Setting the start-level of hibernate-osgi to 100 (higher than all the 
other bundles) worked for me


kind regards,
Christoph


On 2014-01-15 16:13, Dutertry Nicolas wrote:

I used version 3.3.2.GA available in Karaf 3.0.0.

I have also tested version 4.2.7 found here :
https://github.com/lburgazzoli/lb-karaf-features/blob/master/repo/hibernate4.xml

I have finally managed to make this version work. Indeed I found in a hibernate 
tutorial (see last comment in 
https://github.com/hibernate/hibernate-orm/blob/4.2/documentation/src/main/docbook/quickstart/tutorials/osgi/managed-jpa/features.xml)
 that hibernate-osgi must be started after the bundle containing JPA entities.
So to make everything work,  I have to stop the "hibernate-osgi" bundle before installing 
my bundle, and then restart "hibernate-osgi".
For instance :

feature:install hibernate42
stop 127 // NB: 127 is hibernate-osgi bundle
install url_to_my_bundle
start 127


This is somewhat dirty, I hope we can find a better solution.

Regards,
--
Nicolas

-Original Message-
From: Jean-Baptiste Onofré [mailto:j...@nanthrax.net]
Sent: mercredi 15 janvier 2014 15:02
To: user@karaf.apache.org
Subject: Re: JPA with Karaf

Hi Nicolas,

thanks for the update.

What's version of the hibernate feature do you use ?

Regards
JB

On 01/15/2014 02:53 PM, Dutertry Nicolas wrote:

The "hibernate" feature seems to be broken as well. I tried it and got a 
"GracePeriod" state with the same log message :
Bundle test.jpa is waiting for dependencies
[(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=test))(o
bjectClass=javax.persistence.EntityManagerFactory))]

Regards
--
Nicolas
-Original Message-
From: Jean-Baptiste Onofré [mailto:j...@nanthrax.net]
Sent: mercredi 15 janvier 2014 06:46
To: user@karaf.apache.org
Subject: Re: JPA with Karaf

By the way, reviewing the OpenJPA feature, we found that the problem is in the 
feature itself. We fix both OpenJPA 2.2.2 and 2.3.0 features for the next Karaf 
release.

Sorry about that.

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=true)(osgi.unit.name=test))(
o bjectClass=javax.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é
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com



--
Jean-Baptiste Onofré
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com






smime.p7s
Description: S/MIME Cryptographic Signature


Re: JPA with Karaf

2014-01-15 Thread lb
Hi Nicolas,
you are right start order matters for Hibernate, some references:

http://stackoverflow.com/questions/9430270/enterprise-osgi-frameworks-maturity-comparison-apache-aries-vs-eclipse-gemini
http://stackoverflow.com/questions/18387239/jpa-hibernate-error-while-starting-the-service
https://issues.apache.org/jira/browse/ARIES-840
https://github.com/brmeyer/HibernateOSGi/issues/5
https://github.com/lburgazzoli/lb-karaf-examples-jpa/tree/master/jpa-hibernate

I switched to native and unmanaged JPA in my projects (example on
https://github.com/lburgazzoli/lb-karaf-examples-jpa/tree/master/jpa-hibernate-noaries
).

Ciao,
Luca





On Wed, Jan 15, 2014 at 4:13 PM, Dutertry Nicolas <
nicolas.duter...@hraccess.com> wrote:

> I used version 3.3.2.GA available in Karaf 3.0.0.
>
> I have also tested version 4.2.7 found here :
>
> https://github.com/lburgazzoli/lb-karaf-features/blob/master/repo/hibernate4.xml
>
> I have finally managed to make this version work. Indeed I found in a
> hibernate tutorial (see last comment in
> https://github.com/hibernate/hibernate-orm/blob/4.2/documentation/src/main/docbook/quickstart/tutorials/osgi/managed-jpa/features.xml)
> that hibernate-osgi must be started after the bundle containing JPA
> entities.
> So to make everything work,  I have to stop the "hibernate-osgi" bundle
> before installing my bundle, and then restart "hibernate-osgi".
> For instance :
> > feature:install hibernate42
> > stop 127 // NB: 127 is hibernate-osgi bundle
> > install url_to_my_bundle
> > start 127
>
> This is somewhat dirty, I hope we can find a better solution.
>
> Regards,
> --
> Nicolas
>
> -Original Message-
> From: Jean-Baptiste Onofré [mailto:j...@nanthrax.net]
> Sent: mercredi 15 janvier 2014 15:02
> To: user@karaf.apache.org
> Subject: Re: JPA with Karaf
>
> Hi Nicolas,
>
> thanks for the update.
>
> What's version of the hibernate feature do you use ?
>
> Regards
> JB
>
> On 01/15/2014 02:53 PM, Dutertry Nicolas wrote:
> > The "hibernate" feature seems to be broken as well. I tried it and got a
> "GracePeriod" state with the same log message :
> > Bundle test.jpa is waiting for dependencies
> > [(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=test))(o
> > bjectClass=javax.persistence.EntityManagerFactory))]
> >
> > Regards
> > --
> > Nicolas
> > -Original Message-
> > From: Jean-Baptiste Onofré [mailto:j...@nanthrax.net]
> > Sent: mercredi 15 janvier 2014 06:46
> > To: user@karaf.apache.org
> > Subject: Re: JPA with Karaf
> >
> > By the way, reviewing the OpenJPA feature, we found that the problem is
> in the feature itself. We fix both OpenJPA 2.2.2 and 2.3.0 features for the
> next Karaf release.
> >
> > Sorry about that.
> >
> > 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
> >>
> >

RE: JPA with Karaf

2014-01-15 Thread Dutertry Nicolas
I used version 3.3.2.GA available in Karaf 3.0.0.

I have also tested version 4.2.7 found here :
https://github.com/lburgazzoli/lb-karaf-features/blob/master/repo/hibernate4.xml

I have finally managed to make this version work. Indeed I found in a hibernate 
tutorial (see last comment in 
https://github.com/hibernate/hibernate-orm/blob/4.2/documentation/src/main/docbook/quickstart/tutorials/osgi/managed-jpa/features.xml)
 that hibernate-osgi must be started after the bundle containing JPA entities.
So to make everything work,  I have to stop the "hibernate-osgi" bundle before 
installing my bundle, and then restart "hibernate-osgi".
For instance :
> feature:install hibernate42
> stop 127 // NB: 127 is hibernate-osgi bundle
> install url_to_my_bundle
> start 127

This is somewhat dirty, I hope we can find a better solution.

Regards,
--
Nicolas

-Original Message-
From: Jean-Baptiste Onofré [mailto:j...@nanthrax.net] 
Sent: mercredi 15 janvier 2014 15:02
To: user@karaf.apache.org
Subject: Re: JPA with Karaf

Hi Nicolas,

thanks for the update.

What's version of the hibernate feature do you use ?

Regards
JB

On 01/15/2014 02:53 PM, Dutertry Nicolas wrote:
> The "hibernate" feature seems to be broken as well. I tried it and got a 
> "GracePeriod" state with the same log message :
> Bundle test.jpa is waiting for dependencies 
> [(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=test))(o
> bjectClass=javax.persistence.EntityManagerFactory))]
>
> Regards
> --
> Nicolas
> -Original Message-
> From: Jean-Baptiste Onofré [mailto:j...@nanthrax.net]
> Sent: mercredi 15 janvier 2014 06:46
> To: user@karaf.apache.org
> Subject: Re: JPA with Karaf
>
> By the way, reviewing the OpenJPA feature, we found that the problem is in 
> the feature itself. We fix both OpenJPA 2.2.2 and 2.3.0 features for the next 
> Karaf release.
>
> Sorry about that.
>
> 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=true)(osgi.unit.name=test))(
>> o bjectClass=javax.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é
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

--
Jean-Baptiste Onofré
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com


Re: JPA with Karaf

2014-01-15 Thread Jean-Baptiste Onofré

Hi Nicolas,

thanks for the update.

What's version of the hibernate feature do you use ?

Regards
JB

On 01/15/2014 02:53 PM, Dutertry Nicolas wrote:

The "hibernate" feature seems to be broken as well. I tried it and got a 
"GracePeriod" state with the same log message :
Bundle test.jpa is waiting for dependencies 
[(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=test))(objectClass=javax.persistence.EntityManagerFactory))]

Regards
--
Nicolas
-Original Message-
From: Jean-Baptiste Onofré [mailto:j...@nanthrax.net]
Sent: mercredi 15 janvier 2014 06:46
To: user@karaf.apache.org
Subject: Re: JPA with Karaf

By the way, reviewing the OpenJPA feature, we found that the problem is in the 
feature itself. We fix both OpenJPA 2.2.2 and 2.3.0 features for the next Karaf 
release.

Sorry about that.

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=true)(osgi.unit.name=test))(o
bjectClass=javax.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é
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com



--
Jean-Baptiste Onofré
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com


RE: JPA with Karaf

2014-01-15 Thread Dutertry Nicolas
The "hibernate" feature seems to be broken as well. I tried it and got a 
"GracePeriod" state with the same log message :
Bundle test.jpa is waiting for dependencies 
[(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=test))(objectClass=javax.persistence.EntityManagerFactory))]

Regards
--
Nicolas
-Original Message-
From: Jean-Baptiste Onofré [mailto:j...@nanthrax.net] 
Sent: mercredi 15 janvier 2014 06:46
To: user@karaf.apache.org
Subject: Re: JPA with Karaf

By the way, reviewing the OpenJPA feature, we found that the problem is in the 
feature itself. We fix both OpenJPA 2.2.2 and 2.3.0 features for the next Karaf 
release.

Sorry about that.

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=true)(osgi.unit.name=test))(o
> bjectClass=javax.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é
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com


Re: JPA with Karaf

2014-01-14 Thread Jean-Baptiste Onofré
By the way, reviewing the OpenJPA feature, we found that the problem is 
in the feature itself. We fix both OpenJPA 2.2.2 and 2.3.0 features for 
the next Karaf release.


Sorry about that.

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=true)(osgi.unit.name=test))(objectClass=javax.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é
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com


Re: JPA with Karaf

2014-01-14 Thread Jean-Baptiste Onofré
We actually didn't switch as we didn't provide any jpa features 
previously ;)


Regards
JB

On 01/14/2014 02:39 PM, Achim Nierbeck wrote:

Looks like we've been to optimistic for the 2.3. version switch ... :/
sorry about that.

regards, Achim


2014/1/14 Dutertry Nicolas mailto:nicolas.duter...@hraccess.com>>

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 work ?

__ __

Regards

--
Nicolas Dutertry



*From:*Achim Nierbeck [mailto:bcanh...@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.commons-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.serp/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 mailto:bcanh...@googlemail.com>>

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é mailto:j...@nanthrax.net>>

Hi Nicolas,

could you try with OpenJPA 2.2.2 ? AFAIR it seems OpenJPA 2.3.0 has
an issue.

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=true)(osgi.unit.name

=test))(objectClass=javax.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é
jbono...@apache.org 

Re: JPA with Karaf

2014-01-14 Thread Jean-Baptiste Onofré

FYI, Karaf 3.0.1 will provide both OpenJPA 2.2.2 and 2.3.0 features:

The issue is in OpenJPA 2.3.0 and has been identified after the Karaf 
3.0.0 release.


Regards
JB

On 01/14/2014 02:36 PM, Dutertry Nicolas wrote:

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
work ?

Regards

--
Nicolas Dutertry

*From:*Achim Nierbeck [mailto:bcanh...@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.commons-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.serp/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 mailto:bcanh...@googlemail.com>>

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é mailto:j...@nanthrax.net>>

Hi Nicolas,

could you try with OpenJPA 2.2.2 ? AFAIR it seems OpenJPA 2.3.0 has an
issue.

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=true)(osgi.unit.name

<http://osgi.unit.name>=test))(objectClass=javax.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é
jbono...@apache.org <mailto:jbono...@apache.org>
http://blog.nanthrax.net
Talend - http://www.talend.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 <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/>



--
Jean-Baptiste Onofré
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com


Re: JPA with Karaf

2014-01-14 Thread Achim Nierbeck
Looks like we've been to optimistic for the 2.3. version switch ... :/
sorry about that.

regards, Achim


2014/1/14 Dutertry Nicolas 

>  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
> work ?
>
>
>
> Regards
>
> --
> Nicolas Dutertry
>
>  *From:* Achim Nierbeck [mailto:bcanh...@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.commons-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.serp/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é 
>
> Hi Nicolas,
>
> could you try with OpenJPA 2.2.2 ? AFAIR it seems OpenJPA 2.3.0 has an
> issue.
>
> 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=true)(osgi.unit.name
> =test))(objectClass=javax.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é
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>
>
>
>
>
> --
>
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
> P

RE: JPA with Karaf

2014-01-14 Thread Dutertry Nicolas
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 work ?

Regards
--
Nicolas Dutertry

From: Achim Nierbeck [mailto:bcanh...@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.commons-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.serp/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 
mailto:bcanh...@googlemail.com>>
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é mailto:j...@nanthrax.net>>
Hi Nicolas,

could you try with OpenJPA 2.2.2 ? AFAIR it seems OpenJPA 2.3.0 has an issue.

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=true)(osgi.unit.name<http://osgi.unit.name>=test))(objectClass=javax.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é
jbono...@apache.org<mailto:jbono...@apache.org>
http://blog.nanthrax.net
Talend - http://www.talend.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 <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/>


Re: JPA with Karaf

2014-01-14 Thread Achim Nierbeck
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.commons-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.serp/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é 
>
>> Hi Nicolas,
>>
>> could you try with OpenJPA 2.2.2 ? AFAIR it seems OpenJPA 2.3.0 has an
>> issue.
>>
>> 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=true)(osgi.unit.name
>>> =test))(objectClass=javax.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é
>> jbono...@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>
>
>
> --
>
> Apache Karaf  Committer & PMC
> OPS4J Pax Web  Committer &
> Project Lead
> OPS4J Pax for Vaadin 
> Commiter & Project Lead
> blog 
>



-- 

Apache Karaf  Committer & PMC
OPS4J Pax Web  Committer &
Project Lead
OPS4J Pax for Vaadin 
Commiter & Project Lead
blog 


Re: JPA with Karaf

2014-01-14 Thread Christoph Gritschenberger

Hi,

Try adding

org.apache.openjpa.persistence.PersistenceProviderImpl

to your persistence-unit. I got a working setup with OpenJPA 2.3.0.

kind regards,
christoph

On 2014-01-14 12:01, Jean-Baptiste Onofré wrote:

Hi Nicolas,

could you try with OpenJPA 2.2.2 ? AFAIR it seems OpenJPA 2.3.0 has an
issue.

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=true)(osgi.unit.name=test))(objectClass=javax.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







Re: JPA with Karaf

2014-01-14 Thread 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é 

> Hi Nicolas,
>
> could you try with OpenJPA 2.2.2 ? AFAIR it seems OpenJPA 2.3.0 has an
> issue.
>
> 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=true)(osgi.unit.name
>> =test))(objectClass=javax.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é
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>



-- 

Apache Karaf  Committer & PMC
OPS4J Pax Web  Committer &
Project Lead
OPS4J Pax for Vaadin 
Commiter & Project Lead
blog 


Re: JPA with Karaf

2014-01-14 Thread Jean-Baptiste Onofré

Hi Nicolas,

could you try with OpenJPA 2.2.2 ? AFAIR it seems OpenJPA 2.3.0 has an 
issue.


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=true)(osgi.unit.name=test))(objectClass=javax.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é
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com