You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@aries.apache.org by Christian Schneider <ch...@die-schneider.net> on 2012/01/13 09:07:41 UTC
Problem with JPA user bundle not finding EntityManagerFactory. Property
org.apache.aries.jpa.proxy.factory=true missing
Hi all,
I have a problem with Aries JPA and OpenJPA.
My bundle uses container managed persistence. It defines a
persistence.xml and it is picked up by the aries jpa container which
published a service for the EntitiyManagerFactory.
I inject the EntityManager using blueprint like in the Trader example.
The problem is that the blueprint integration looks for another OSGi
service than the container provides.
This is what the bundle searches for:
----
2012-01-13 09:02:21,001 | INFO | rint Extender: 3 |
BlueprintContainerImpl | container.BlueprintContainerImpl 305
| 9 - org.apache.aries.blueprint - 0.3.1 | Bundle db-examplejpa is
waiting for dependencies [(&(&(org.apache.aries
.jpa.proxy.factory=true)(osgi.unit.name=person))(objectClass=javax.persistence.EntityManagerFactory))]
----
And this is what the bundle provides:
db-examplejpa (68) provides:
----------------------------
objectClass = javax.persistence.EntityManagerFactory
org.apache.aries.jpa.container.managed = true
org.apache.aries.jpa.default.unit.name = false
osgi.unit.name = person
osgi.unit.provider = org.apache.openjpa.persistence.PersistenceProviderImpl
osgi.unit.version = 2.1.1
service.id = 216
-----
So it seem the property "org.apache.aries.jpa.proxy.factory=true" is
missing. So the service can not be bound.
Any ideas how I can solve this?
Here is my complete project:
https://github.com/cschneider/Karaf-Tutorial/tree/master/db/examplejpa
Christian
--
Christian Schneider
http://www.liquid-reality.de
Open Source Architect
Talend Application Integration Division http://www.talend.com
Re: Problem with JPA user bundle not finding EntityManagerFactory.
Property org.apache.aries.jpa.proxy.factory=true missing
Posted by Christian Schneider <ch...@die-schneider.net>.
Just found it.
I only had the jpa container bundle installed while I also needed the
container.context bundle.
Now my bundle shows status created.
Btw. I think there should also be a non eba deployment of the
ariestrader example. I would prefer a feature.
Christian
Am 13.01.2012 09:07, schrieb Christian Schneider:
> Hi all,
>
> I have a problem with Aries JPA and OpenJPA.
>
> My bundle uses container managed persistence. It defines a
> persistence.xml and it is picked up by the aries jpa container which
> published a service for the EntitiyManagerFactory.
>
> I inject the EntityManager using blueprint like in the Trader example.
>
> The problem is that the blueprint integration looks for another OSGi
> service than the container provides.
>
> This is what the bundle searches for:
> ----
> 2012-01-13 09:02:21,001 | INFO | rint Extender: 3 |
> BlueprintContainerImpl | container.BlueprintContainerImpl
> 305 | 9 - org.apache.aries.blueprint - 0.3.1 | Bundle db-examplejpa is
> waiting for dependencies [(&(&(org.apache.aries
> .jpa.proxy.factory=true)(osgi.unit.name=person))(objectClass=javax.persistence.EntityManagerFactory))]
>
> ----
>
> And this is what the bundle provides:
> db-examplejpa (68) provides:
> ----------------------------
> objectClass = javax.persistence.EntityManagerFactory
> org.apache.aries.jpa.container.managed = true
> org.apache.aries.jpa.default.unit.name = false
> osgi.unit.name = person
> osgi.unit.provider =
> org.apache.openjpa.persistence.PersistenceProviderImpl
> osgi.unit.version = 2.1.1
> service.id = 216
> -----
>
> So it seem the property "org.apache.aries.jpa.proxy.factory=true" is
> missing. So the service can not be bound.
>
> Any ideas how I can solve this?
>
>
> Here is my complete project:
> https://github.com/cschneider/Karaf-Tutorial/tree/master/db/examplejpa
>
> Christian
>
--
Christian Schneider
http://www.liquid-reality.de
Open Source Architect
Talend Application Integration Division http://www.talend.com