You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Matt Madhavan <ma...@gmail.com> on 2011/09/16 21:51:32 UTC

Features/bundles for OpenJPA/JTA

Hello,
I'm new to Karaf! I'm trying to port on of my app that uses
Aries/OpenJPA/derby/JTA trasaction etc. I have tested this successfully
using pax:provision in Felix container.

I'm having some issues with KARAF. Looks like KARAF already has bunch of
bundles installed like JTA/JNDI/JPA etc.

My datasource bundle resolves ok (Embedded Derby). But when I install my
persistence bundle it gets activate but does no create any service. The log
says as follows:

2011-09-16 14:38:57,375 | ERROR | rint Extender: 2 | BlueprintContainerImpl          
| ntainer.BlueprintContainerImpl$1  293 | 9 - org.apache.aries.blueprint -
0.3.1 | Unable to start blueprint container for bundle itso.bank.persistence
due to unresolved dependencies
[(&(&(*org.apache.aries.jpa.proxy.factory*=true)(osgi.unit.name=itso.bank.persistence))(objectClass=javax.persistence.EntityManagerFactory))]
java.util.concurrent.TimeoutException
	at
org.apache.aries.blueprint.container.BlueprintContainerImpl$1.run(BlueprintContainerImpl.java:287)[9:org.apache.aries.blueprint:0.3.1]
	at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)[:1.6.0_23]
	at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)[:1.6.0_23]
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)[:1.6.0_23]


Any ideas please?

Thanks in advance!

Matt



--
View this message in context: http://karaf.922171.n3.nabble.com/Features-bundles-for-OpenJPA-JTA-tp3342895p3342895.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Features/bundles for OpenJPA/JTA

Posted by ialexei <ai...@gmail.com>.
Never mind, Changing run level using osgi:bundle-level to 19 stops throwing
the exception on logout.



--
View this message in context: http://karaf.922171.n3.nabble.com/Features-bundles-for-OpenJPA-JTA-tp3342895p4028876.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Features/bundles for OpenJPA/JTA

Posted by ialexei <ai...@gmail.com>.
Hi JB,

I ran into this exact issue and installing jpa after OpenJPA jar resolved
this.
There seems to be an order in which these bundles need to be installed.

However when I logout of karaf I get the following exception.

-Alexei

170239  osapu  TRACE  [FelixStartLevel] openjpa.Runtime -
org.apache.openjpa.persistence.EntityManagerFactoryImpl@7139acf.close()
invoked.
ERROR: Bundle org.apache.aries.jpa.container [125] Error stopping bundle.
(java.lang.IllegalStateException: No persistence units defined for bundle
osa-dao/1.0.0.)
java.lang.IllegalStateException: No persistence units defined for bundle
osa-dao/1.0.0.
	at
org.apache.aries.jpa.container.unit.impl.ManagedPersistenceUnitInfoFactoryImpl.destroyPersistenceBundle(ManagedPersistenceUnitInfoFactoryImpl.java:60)
	at
org.apache.aries.jpa.container.impl.PersistenceBundleManager.removedBundle(PersistenceBundleManager.java:313)
	at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerRemoved(BundleHookBundleTracker.java:513)
	at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerRemoved(BundleHookBundleTracker.java:433)
	at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.untrack(BundleHookBundleTracker.java:834)
	at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker.close(BundleHookBundleTracker.java:196)
	at
org.apache.aries.util.tracker.RecursiveBundleTracker.close(RecursiveBundleTracker.java:120)
	at
org.apache.aries.jpa.container.impl.PersistenceBundleManager.close(PersistenceBundleManager.java:140)
	at
org.apache.aries.jpa.container.impl.PersistenceBundleManager.stop(PersistenceBundleManager.java:643)
	at
org.apache.felix.framework.util.SecureAction.stopActivator(SecureAction.java:667)
	at org.apache.felix.framework.Felix.stopBundle(Felix.java:2361)
	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1214)
	at
org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:295)
	at java.lang.Thread.run(Thread.java:679)
ERROR: Bundle org.apache.aries.jpa.container [125] Error stopping
mvn:org.apache.aries.jpa/org.apache.aries.jpa.container/1.0.0
(org.osgi.framework.BundleException: Activator stop error in bundle
org.apache.aries.jpa.container [125].)
java.lang.IllegalStateException: No persistence units defined for bundle
osa-dao/1.0.0.
	at
org.apache.aries.jpa.container.unit.impl.ManagedPersistenceUnitInfoFactoryImpl.destroyPersistenceBundle(ManagedPersistenceUnitInfoFactoryImpl.java:60)
	at
org.apache.aries.jpa.container.impl.PersistenceBundleManager.removedBundle(PersistenceBundleManager.java:313)
	at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerRemoved(BundleHookBundleTracker.java:513)
	at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerRemoved(BundleHookBundleTracker.java:433)
	at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.untrack(BundleHookBundleTracker.java:834)
	at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker.close(BundleHookBundleTracker.java:196)
	at
org.apache.aries.util.tracker.RecursiveBundleTracker.close(RecursiveBundleTracker.java:120)
	at
org.apache.aries.jpa.container.impl.PersistenceBundleManager.close(PersistenceBundleManager.java:140)
	at
org.apache.aries.jpa.container.impl.PersistenceBundleManager.stop(PersistenceBundleManager.java:643)
	at
org.apache.felix.framework.util.SecureAction.stopActivator(SecureAction.java:667)
	at org.apache.felix.framework.Felix.stopBundle(Felix.java:2361)
	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1214)
	at
org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:295)
	at java.lang.Thread.run(Thread.java:679)



--
View this message in context: http://karaf.922171.n3.nabble.com/Features-bundles-for-OpenJPA-JTA-tp3342895p4028873.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Features/bundles for OpenJPA/JTA

Posted by Ioannis Canellos <io...@gmail.com>.
I think that the feature for jta is called transaction.


-- 
*Ioannis Canellos*
*
FuseSource <http://fusesource.com>

**
Blog: http://iocanel.blogspot.com
**
Apache Karaf <http://karaf.apache.org/> Committer & PMC
Apache ServiceMix <http://servicemix.apache.org/>  Committer
Apache Gora <http://incubator.apache.org/gora/> Committer
*

Re: Features/bundles for OpenJPA/JTA

Posted by Andreas Pieber <an...@gmail.com>.
Hey Matt,

can you attach the output of a "bundles" command in your pax-runner env and
a "la" command in karaf?

Thanks and kind regards,
Andreas

On Sat, Sep 17, 2011 at 21:11, Matt Madhavan <ma...@gmail.com> wrote:

> Hi JB,
> I have deleted my Karaf installation and starting from scratch again.
>
> I do not see any features for jta when I do the features:list. I do see jpa
> and jndi.
>
> Where can I get the JTA feature? If not I can make one my self. Please let
> me know what should comprise of JTA feature.
>
> Currently I have geraninimo-transaction and geranimo-jta.
>
> Thanks in advance!
>
> Matt
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Features-bundles-for-OpenJPA-JTA-tp3342895p3344744.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

Re: Features/bundles for OpenJPA/JTA

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

the JTA feature is part of the enterprise features, and named transaction.

Regards
JB

On 09/17/2011 09:11 PM, Matt Madhavan wrote:
> Hi JB,
> I have deleted my Karaf installation and starting from scratch again.
>
> I do not see any features for jta when I do the features:list. I do see jpa
> and jndi.
>
> Where can I get the JTA feature? If not I can make one my self. Please let
> me know what should comprise of JTA feature.
>
> Currently I have geraninimo-transaction and geranimo-jta.
>
> Thanks in advance!
>
> Matt
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Features-bundles-for-OpenJPA-JTA-tp3342895p3344744.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: Features/bundles for OpenJPA/JTA

Posted by Matt Madhavan <ma...@gmail.com>.
Hi JB,
I have deleted my Karaf installation and starting from scratch again. 

I do not see any features for jta when I do the features:list. I do see jpa
and jndi.

Where can I get the JTA feature? If not I can make one my self. Please let
me know what should comprise of JTA feature.

Currently I have geraninimo-transaction and geranimo-jta.

Thanks in advance!

Matt

--
View this message in context: http://karaf.922171.n3.nabble.com/Features-bundles-for-OpenJPA-JTA-tp3342895p3344744.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Features/bundles for OpenJPA/JTA

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

Did you install the jta and jpa features ?

karaf@root> features:install jta
karaf@root> features:install jpa

Be careful, the jpa feature doesn't install the jpa engine, you have to 
it by hand before installing the feature.

In your case, we reach the timeout waiting for the EntityManagerFactory.

Could you provide the OSGi statements for your itso.bank.persistence ?

Regards
JB


On 09/16/2011 09:51 PM, Matt Madhavan wrote:
> Hello,
> I'm new to Karaf! I'm trying to port on of my app that uses
> Aries/OpenJPA/derby/JTA trasaction etc. I have tested this successfully
> using pax:provision in Felix container.
>
> I'm having some issues with KARAF. Looks like KARAF already has bunch of
> bundles installed like JTA/JNDI/JPA etc.
>
> My datasource bundle resolves ok (Embedded Derby). But when I install my
> persistence bundle it gets activate but does no create any service. The log
> says as follows:
>
> 2011-09-16 14:38:57,375 | ERROR | rint Extender: 2 | BlueprintContainerImpl
> | ntainer.BlueprintContainerImpl$1  293 | 9 - org.apache.aries.blueprint -
> 0.3.1 | Unable to start blueprint container for bundle itso.bank.persistence
> due to unresolved dependencies
> [(&(&(*org.apache.aries.jpa.proxy.factory*=true)(osgi.unit.name=itso.bank.persistence))(objectClass=javax.persistence.EntityManagerFactory))]
> java.util.concurrent.TimeoutException
> 	at
> org.apache.aries.blueprint.container.BlueprintContainerImpl$1.run(BlueprintContainerImpl.java:287)[9:org.apache.aries.blueprint:0.3.1]
> 	at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)[:1.6.0_23]
> 	at
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)[:1.6.0_23]
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:138)[:1.6.0_23]
>
>
> Any ideas please?
>
> Thanks in advance!
>
> Matt
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Features-bundles-for-OpenJPA-JTA-tp3342895p3342895.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