You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by ellirael <el...@mail.ru> on 2014/05/29 20:10:50 UTC

Container management JPA example

I'm trying to run my JPA test bundles on Karaf 3.0.1. But it doesn't work.
The problem is my bundle in GracePeriondState and awaiting dependencies
[(&(&(org.apache.aries.jpa.proxy.factory=true).
I've tried both versions of openjpa.

Looking through this mailing list I couldn't finally figure whether
container management JPA is working with Karaf 3.0.1 or not.

Can anybody provide simple working example?



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

Re: Container management JPA example

Posted by "Jamie G." <ja...@gmail.com>.
Yes, as JB has stated - its from the up coming Apache Karaf Cookbook
(Packt Publishing). We're hoping it'll be available soon :)

Cheers,
Jamie

On Sun, Jun 1, 2014 at 1:49 PM, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> Hi,
>
> yes, it should work with Karaf 3.0.1 (it's the target version of the
> cookbook).
>
> And yes, CMP should be supported as well.
>
> FYI, I'm working on JPA 2.1 support in Aries JPA, and I will add a itest
> (using Pax Exam as started by Christian in Aries).
>
> Regards
> JB
>
>
> On 06/01/2014 04:16 PM, ellirael wrote:
>>
>> Jamie, thanks. Have you tried those recipes? Is is working with Karaf
>> 3.0.1
>> and container management JPA? Container management JPA is one of the main
>> Karaf features. And I cannot stop trying to use it.
>>
>>
>>
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/Container-management-JPA-example-tp4033329p4033365.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com

Re: Container management JPA example

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

yes, it should work with Karaf 3.0.1 (it's the target version of the 
cookbook).

And yes, CMP should be supported as well.

FYI, I'm working on JPA 2.1 support in Aries JPA, and I will add a itest 
(using Pax Exam as started by Christian in Aries).

Regards
JB

On 06/01/2014 04:16 PM, ellirael wrote:
> Jamie, thanks. Have you tried those recipes? Is is working with Karaf 3.0.1
> and container management JPA? Container management JPA is one of the main
> Karaf features. And I cannot stop trying to use it.
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Container-management-JPA-example-tp4033329p4033365.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

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

Re: Container management JPA example

Posted by ellirael <el...@mail.ru>.
Jamie, thanks. Have you tried those recipes? Is is working with Karaf 3.0.1
and container management JPA? Container management JPA is one of the main
Karaf features. And I cannot stop trying to use it.



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

Re: Container management JPA example

Posted by "Jamie G." <ja...@gmail.com>.
Have a look at the recipes here:
https://github.com/jgoodyear/ApacheKarafCookbook/tree/master/chapter7

Cheers,
Jamie

On Fri, May 30, 2014 at 8:04 AM, ellirael <el...@mail.ru> wrote:
> JB, yes.
>
> Result of "package:exports | grep javax.persistence" command:
> javax.persistence | 1.1.0 | 82 |
> org.apache.geronimo.specs.geronimo-jpa_2.0_spec
> javax.persistence | 2.0.0 | 82 |
> org.apache.geronimo.specs.geronimo-jpa_2.0_spec
>
> Result of "la | grep 82" command:
>  82 | Active   |  30 | 1.1                   | Apache Geronimo JSR-317 JPA
> 2.0 Spec API
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Container-management-JPA-example-tp4033329p4033349.html
> Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Container management JPA example

Posted by ellirael <el...@mail.ru>.
JB, yes.

Result of "package:exports | grep javax.persistence" command:
javax.persistence | 1.1.0 | 82 |
org.apache.geronimo.specs.geronimo-jpa_2.0_spec
javax.persistence | 2.0.0 | 82 |
org.apache.geronimo.specs.geronimo-jpa_2.0_spec 

Result of "la | grep 82" command:
 82 | Active   |  30 | 1.1                   | Apache Geronimo JSR-317 JPA
2.0 Spec API




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

Re: Container management JPA example

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Did you install the geronimo-jpa specs bundle (2.0) ?

Regards
JB

On 05/30/2014 11:22 AM, ellirael wrote:
> Thanks again, Christian.
>
> I've installed snapshot version.
> But I've met another poroblem running my test jpa bundle.
>
> Karaf log fragment:
> 2014-05-30 12:59:02,895 | WARN  | raf-3.0.1/deploy | fileinstall
> | 11 - org.apache.felix.fileinstall - 3.2.8 | Error while starting bundle:
> deploy/user.api-0.0.0.jar
> org.osgi.framework.BundleException: Unresolved constraint in bundle user.api
> [78]: Unable to resolve 78.0: missing requirement [78.0]
> osgi.wiring.package;
> (&(osgi.wiring.package=javax.persistence)(version>=1.1.0)(!(version>=2.0.0)))
> 	at
> org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3974)[org.apache.felix.framework-4.2.1.jar:]
>
> My bundle manifest fragment:
> Import-Package: javax.persistence;version="[1.1,2)",org.osgi.service.blu
>   eprint;version="[1.0.0,2.0.0)"
>
> Result of "package:exports | grep javax.persistence" command (meaningless
> packages omited):
> javax.persistence | 1.1.0 | 82 |
> org.apache.geronimo.specs.geronimo-jpa_2.0_spec
> javax.persistence | 2.0.0 | 82 |
> org.apache.geronimo.specs.geronimo-jpa_2.0_spec
>
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Container-management-JPA-example-tp4033329p4033346.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

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

Re: Container management JPA example

Posted by ellirael <el...@mail.ru>.
Thanks again, Christian.

I've installed snapshot version.
But I've met another poroblem running my test jpa bundle.

Karaf log fragment:
2014-05-30 12:59:02,895 | WARN  | raf-3.0.1/deploy | fileinstall                     
| 11 - org.apache.felix.fileinstall - 3.2.8 | Error while starting bundle:
deploy/user.api-0.0.0.jar
org.osgi.framework.BundleException: Unresolved constraint in bundle user.api
[78]: Unable to resolve 78.0: missing requirement [78.0]
osgi.wiring.package;
(&(osgi.wiring.package=javax.persistence)(version>=1.1.0)(!(version>=2.0.0)))
	at
org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3974)[org.apache.felix.framework-4.2.1.jar:]

My bundle manifest fragment:
Import-Package: javax.persistence;version="[1.1,2)",org.osgi.service.blu
 eprint;version="[1.0.0,2.0.0)"

Result of "package:exports | grep javax.persistence" command (meaningless
packages omited):
javax.persistence | 1.1.0 | 82 |
org.apache.geronimo.specs.geronimo-jpa_2.0_spec
javax.persistence | 2.0.0 | 82 |
org.apache.geronimo.specs.geronimo-jpa_2.0_spec





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

Re: Container management JPA example

Posted by Christian Schneider <ch...@die-schneider.net>.
Try with one of the snapshots here:
http://repository.apache.org/content/groups/snapshots/org/apache/aries/jpa/org.apache.aries.jpa.container/1.0.1-SNAPSHOT/

I hope we can arrange an aries jpa container release shortly and 
incorporate it into the next karaf bugfix release.

Christian

On 30.05.2014 10:10, ellirael wrote:
> Thanks for your reply.
> I've tried to build snapshot version. But it failed for different reasons.
> For example: Plugin
> org.apache.aries.versioning:org.apache.aries.versioning.plugin:0.1.0 or one
> of its dependencies could not be resolved: Failed to read artifact
> descriptor for; or compiler errors in the sources like unimplemented
> abstract methods in ConnectionWrapper class.
> Is it possible you provide builded binary org.apache.aries.jpa.container
> version 1.0.1-SNAPSHOT?
> It would be helpfull for all karaf users.
> May be post this version on karaf site pages near release download links?
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Container-management-JPA-example-tp4033329p4033344.html
> Sent from the Karaf - User mailing list archive at Nabble.com.


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: Container management JPA example

Posted by ellirael <el...@mail.ru>.
Thanks for your reply.
I've tried to build snapshot version. But it failed for different reasons.
For example: Plugin
org.apache.aries.versioning:org.apache.aries.versioning.plugin:0.1.0 or one
of its dependencies could not be resolved: Failed to read artifact
descriptor for; or compiler errors in the sources like unimplemented
abstract methods in ConnectionWrapper class.
Is it possible you provide builded binary org.apache.aries.jpa.container
version 1.0.1-SNAPSHOT?
It would be helpfull for all karaf users.
May be post this version on karaf site pages near release download links?



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

Re: Container management JPA example

Posted by Christian Schneider <ch...@die-schneider.net>.
You might have hit the issue 
https://issues.apache.org/jira/browse/ARIES-1160 .
The title is a bit misleading. The issue has two implications:

1. You will not see if initialization of your persistence unit goes wrong
2. The persistence unit will not work until you restart the aries jpa 
container bundle.

Please try if the patch or the new snapshot fixes your problem.

You can find an example at:
https://github.com/cschneider/Karaf-Tutorial/tree/master/db/examplejpa

Christian

Am 29.05.2014 20:10, schrieb ellirael:
> I'm trying to run my JPA test bundles on Karaf 3.0.1. But it doesn't work.
> The problem is my bundle in GracePeriondState and awaiting dependencies
> [(&(&(org.apache.aries.jpa.proxy.factory=true).
> I've tried both versions of openjpa.
>
> Looking through this mailing list I couldn't finally figure whether
> container management JPA is working with Karaf 3.0.1 or not.
>
> Can anybody provide simple working example?
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Container-management-JPA-example-tp4033329.html
> Sent from the Karaf - User mailing list archive at Nabble.com.


-- 
  
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com