You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Aryan <ka...@gmail.com> on 2014/11/06 10:38:46 UTC

Configuring hibernate with blueprint in karaf

Hi,

We are trying to deploy a hibernate based jpa application in karaf. But we
are facing issue for no suitable provider class.

We tried with following 2 providers but got same issue for both.
Persistence-provider: org.hibernate.osgi.HibernateBundleActivator
2014-11-06 14:18:46,814 | WARN  | Local user karaf | container                       
| 229 - org.apache.aries.jpa.container - 1.0.0 | There are no suitable
providers for the provider class name
org.hibernate.osgi.HibernateBundleActivator and version range null to
support the bundle com.ggs.re-core/1.0.1.
2014-11-06 14:18:46,962 | WARN  | Local user karaf | container                       
| 229 - org.apache.aries.jpa.container - 1.0.0 | There are no suitable
providers for the provider class name
org.hibernate.osgi.HibernateBundleActivator and version range null to
support the bundle com.ggs.re-core/1.0.1.
2014-11-06 14:18:46,982 | WARN  | Local user karaf | container                       
| 229 - org.apache.aries.jpa.container - 1.0.0 | There are no suitable
providers for the provider class name
org.hibernate.osgi.HibernateBundleActivator and version range null to
support the bundle com.ggs.re-core/1.0.1.
2014-11-06 14:18:47,139 | INFO  | Local user karaf | BlueprintContainerImpl          
| 4 - org.apache.aries.blueprint.core - 1.3.0 | Bundle com.routing is
waiting for dependencies
[(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=entityManager))(objectClass=javax.persistence.EntityManagerFactory)),
(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=entityManager))(objectClass=javax.persistence.EntityManagerFactory)),
(&(&(!(org.apache.aries.jpa.proxy.factory=*))(osgi.unit.name=entityManager))(objectClass=javax.persistence.EntityManagerFactory)),
(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=entityManager))(objectClass=javax.persistence.EntityManagerFactory)),
(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=entityManager))(objectClass=javax.persistence.EntityManagerFactory))]
2014-11-06 14:18:47,153 | WARN  | Local user karaf | container                       
| 229 - org.apache.aries.jpa.container - 1.0.0 | There are no suitable
providers for the provider class name
org.hibernate.osgi.HibernateBundleActivator and version range null to
support the bundle com.ggs.re-core/1.0.1.


Persistence-provider: org.hibernate.ejb.HibernatePersistence
2014-11-06 14:18:46,814 | WARN  | Local user karaf | container                       
| 229 - org.apache.aries.jpa.container - 1.0.0 | There are no suitable
providers for the provider class name org.hibernate.ejb.HibernatePersistence
and version range null to support the bundle com.ggs.re-core/1.0.1.
2014-11-06 14:18:46,962 | WARN  | Local user karaf | container                       
| 229 - org.apache.aries.jpa.container - 1.0.0 | There are no suitable
providers for the provider class name org.hibernate.ejb.HibernatePersistence
and version range null to support the bundle com.ggs.re-core/1.0.1.
2014-11-06 14:18:46,982 | WARN  | Local user karaf | container                       
| 229 - org.apache.aries.jpa.container - 1.0.0 | There are no suitable
providers for the provider class name org.hibernate.ejb.HibernatePersistence
and version range null to support the bundle com.ggs.re-core/1.0.1.
2014-11-06 14:18:47,139 | INFO  | Local user karaf | BlueprintContainerImpl          
| 4 - org.apache.aries.blueprint.core - 1.3.0 | Bundle com.routing is
waiting for dependencies
[(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=entityManager))(objectClass=javax.persistence.EntityManagerFactory)),
(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=entityManager))(objectClass=javax.persistence.EntityManagerFactory)),
(&(&(!(org.apache.aries.jpa.proxy.factory=*))(osgi.unit.name=entityManager))(objectClass=javax.persistence.EntityManagerFactory)),
(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=entityManager))(objectClass=javax.persistence.EntityManagerFactory)),
(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=entityManager))(objectClass=javax.persistence.EntityManagerFactory))]
2014-11-06 14:18:47,153 | WARN  | Local user karaf | container                       
| 229 - org.apache.aries.jpa.container - 1.0.0 | There are no suitable
providers for the provider class name org.hibernate.ejb.HibernatePersistence
and version range null to support the bundle com.ggs.re-core/1.0.1.

Below are modules that we installed for hibernate and one module which is
giving problem while installing. Complete bundle & feature list is attached
in the mail along with persistence.xml configuration.

Hibernate features/modules:
423 | Active      |  80 |            |
mvn:org.hibernate.common/hibernate-commons-annotations/4.0.1.Final
424 | Active      |  80 |            |
mvn:org.hibernate/hibernate-core/4.0.1.Final
425 | Active      |  80 |            |
mvn:org.hibernate/hibernate-entitymanager/4.0.1.Final
429 | Active      |  80 |            |
mvn:org.hibernate.javax.persistence/hibernate-jpa-2.0-api/1.0.1.Final
Tried installing this module: install -s
mvn:org.hibernate/hibernate-osgi/4.2.0.Final but got following error
2014-11-06 14:23:47,010 | ERROR | Local user karaf | ShellUtil                       
| 47 - org.apache.karaf.shell.console - 3.0.0 | Exception caught while
executing command
org.apache.karaf.shell.console.MultiException: Error installing bundles:
                Unable to start bundle
mvn:org.hibernate/hibernate-osgi/4.2.0.Final
                at
org.apache.karaf.shell.console.MultiException.throwIf(MultiException.java:92)
                at
org.apache.karaf.bundle.command.Install.doExecute(Install.java:69)
                at
org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33)
                at
org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:39)
                at
org.apache.karaf.shell.commands.basic.AbstractCommand.execute(AbstractCommand.java:33)
                at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown
Source)
                at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_51]
                at
java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_51]
                at
org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:54)
                at
org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:119)
                at
org.apache.karaf.shell.console.commands.$BlueprintCommand2019090948.execute(Unknown
Source)[47:org.apache.karaf.shell.console:3.0.0]
                at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown
Source)
                at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_51]
                at
java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_51]
                at
org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:54)
                at
org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:119)
                at
org.apache.karaf.shell.console.commands.$BlueprintCommand2019090948.execute(Unknown
Source)[47:org.apache.karaf.shell.console:3.0.0]
                at
org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[47:org.apache.karaf.shell.console:3.0.0]
                at
org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)[47:org.apache.karaf.shell.console:3.0.0]
                at
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)[47:org.apache.karaf.shell.console:3.0.0]
                at
org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[47:org.apache.karaf.shell.console:3.0.0]
                at
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[47:org.apache.karaf.shell.console:3.0.0]
                at
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[47:org.apache.karaf.shell.console:3.0.0]
                at
org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
                at
org.apache.karaf.shell.console.impl.jline.ConsoleImpl$DelegateSession.execute(ConsoleImpl.java:497)
                at
org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:198)
                at java.lang.Thread.run(Thread.java:744)[:1.7.0_51]
                at
org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.doRun(ConsoleFactoryService.java:118)[47:org.apache.karaf.shell.console:3.0.0]
                at
org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3$1.run(ConsoleFactoryService.java:109)
                at java.security.AccessController.doPrivileged(Native
Method)[:1.7.0_51]
                at
org.apache.karaf.jaas.modules.JaasHelper.doAs(JaasHelper.java:47)[48:org.apache.karaf.jaas.modules:3.0.0]
                at
org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.run(ConsoleFactoryService.java:107)[47:org.apache.karaf.shell.console:3.0.0]
Caused by: java.lang.Exception: Unable to start bundle
mvn:org.hibernate/hibernate-osgi/4.2.0.Final
                at
org.apache.karaf.bundle.command.Install.doExecute(Install.java:53)
                ... 30 more
Caused by: org.osgi.framework.BundleException: Unresolved constraint in
bundle org.hibernate.osgi [442]: Unable to resolve 442.0: missing
requirement [442.0] osgi.wiring.package;
(osgi.wiring.package=org.hibernate.ejb)
                at
org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3974)
                at
org.apache.felix.framework.Felix.startBundle(Felix.java:2037)
                at
org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)
                at
org.apache.felix.framework.BundleImpl.start(BundleImpl.java:942)
                at
org.apache.karaf.bundle.command.Install.doExecute(Install.java:51)
                ... 30 more
2014-11-06 14:23:47,185 | ERROR | rint Extender: 3 | BlueprintContainerImpl          
| 4 - org.apache.aries.blueprint.core - 1.3.0 | Unable to start blueprint
container for bundle com.routing due to unresolved dependencies
[(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=entityManager))(objectClass=javax.persistence.EntityManagerFactory)),
(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=entityManager))(objectClass=javax.persistence.EntityManagerFactory)),
(&(&(!(org.apache.aries.jpa.proxy.factory=*))(osgi.unit.name=entityManager))(objectClass=javax.persistence.EntityManagerFactory)),
(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=entityManager))(objectClass=javax.persistence.EntityManagerFactory)),
(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=entityManager))(objectClass=javax.persistence.EntityManagerFactory))]
java.util.concurrent.TimeoutException
                at
org.apache.aries.blueprint.container.BlueprintContainerImpl$1.run(BlueprintContainerImpl.java:336)[4:org.apache.aries.blueprint.core:1.3.0]
                at
org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)[4:org.apache.aries.blueprint.core:1.3.0]
                at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_51]
                at
java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_51]
                at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)[:1.7.0_51]
                at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[:1.7.0_51]
                at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_51]
                at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_51]
                at java.lang.Thread.run(Thread.java:744)[:1.7.0_51]

Attached the features installed karaf together with my persistence file.

When we switch the persistence provider to opejpa, everything works fine.
feature_bundle_list.txt
<http://camel.465427.n5.nabble.com/file/n5758588/feature_bundle_list.txt>  
persistence.xml
<http://camel.465427.n5.nabble.com/file/n5758588/persistence.xml>  

Please help in resolving this issue.
Thanks.

Regards,
Aryan



--
View this message in context: http://camel.465427.n5.nabble.com/Configuring-hibernate-with-blueprint-in-karaf-tp5758588.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Configuring hibernate with blueprint in karaf

Posted by Henryk Konsek <he...@gmail.com>.
Hi,

> We are trying to deploy a hibernate based jpa application in karaf. But we
> are facing issue for no suitable provider class.

Here [1] is the complete working example of Hibernate 4.2 with
Blueprint and Aries transaction management. Backed by Pax Exam tests,
so you can verify it works indeed by executing 'mvn install' :) . We
use similar configuration of Hibernate in Fuse 6.1.

Laters!

[1] https://github.com/hekonsek/fuse-pocs/tree/master/fuse-pocs-blueprint-hibernate42

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com

Re: Configuring hibernate with blueprint in karaf

Posted by Aryan <ka...@gmail.com>.
Thanks for the reply guys.
I took the versions from Henryk's example and now I was able to
deploy/install those jars.
(Before this I wasn't able to deploy hibernate-osgi successfully).

09 | Active    |  80 | 4.0.4.Final  | hibernate-commons-annotations
11 | Active    |  80 | 1.2.1.Final  | Java Annotation Indexer
43 | Active    |  80 |              |
mvn:org.hibernate.javax.persistence/hibernate-jpa-2.0-api/1.0.1.Final
44 | Active    |  80 | 4.2.11.Final | hibernate-core
47 | Active    |  50 | 2.3.0        | OpenJPA Aggregate Jar
48 | Active    |  80 | 4.2.11.Final | hibernate-entitymanager
59 | Active    |  80 | 4.2.11.Final | hibernate-osgi
60 | Active    |  80 |              |
mvn:org.hibernate.common/hibernate-commons-annotations/4.0.0.Final
62 | Active    |  80 |              |
mvn:org.hibernate/hibernate-annotations/3.5.6-Final

But now when I try to deploy my application, I get a wiring error for
javax.persistence.EntityManagerFactory.
This is present in hibernate-jpa-2.0-api which is successfully installed in
Active state.

2014-11-07 15:06:44,122 | ERROR | Local user karaf | ShellUtil                       
| 47 - org.apache.karaf.shell.console - 3.0.0 | Exception caught while
executing command
org.apache.karaf.shell.console.MultiException: Error installing bundles:
        Unable to start bundle mvn:com.routing/1.0.0
        at
org.apache.karaf.shell.console.MultiException.throwIf(MultiException.java:92)
        at
org.apache.karaf.bundle.command.Install.doExecute(Install.java:69)
        at
org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33)
        at
org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:39)
        at
org.apache.karaf.shell.commands.basic.AbstractCommand.execute(AbstractCommand.java:33)
        at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)[:1.7.0_21]
        at java.lang.reflect.Method.invoke(Unknown Source)[:1.7.0_21]
        at
org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:54)
        at
org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:119)
        at
org.apache.karaf.shell.console.commands.$BlueprintCommand23469552.execute(Unknown
Source)[47:org.apache.karaf.shell.console:3.0.0]
        at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)[:1.7.0_21]
        at java.lang.reflect.Method.invoke(Unknown Source)[:1.7.0_21]
        at
org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:54)
        at
org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:119)
        at
org.apache.karaf.shell.console.commands.$BlueprintCommand23469552.execute(Unknown
Source)[47:org.apache.karaf.shell.console:3.0.0]
        at
org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[47:org.apache.karaf.shell.console:3.0.0]
        at
org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)[47:org.apache.karaf.shell.console:3.0.0]
        at
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)[47:org.apache.karaf.shell.console:3.0.0]
        at
org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[47:org.apache.karaf.shell.console:3.0.0]
        at
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[47:org.apache.karaf.shell.console:3.0.0]
        at
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[47:org.apache.karaf.shell.console:3.0.0]
        at
org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
        at
org.apache.karaf.shell.console.impl.jline.ConsoleImpl$DelegateSession.execute(ConsoleImpl.java:497)
        at
org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:198)
        at java.lang.Thread.run(Unknown Source)[:1.7.0_21]
        at
org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.doRun(ConsoleFactoryService.java:118)[47:org.apache.karaf.shell.console:3.0.0]
        at
org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3$1.run(ConsoleFactoryService.java:109)
        at java.security.AccessController.doPrivileged(Native
Method)[:1.7.0_21]
        at
org.apache.karaf.jaas.modules.JaasHelper.doAs(JaasHelper.java:47)[48:org.apache.karaf.jaas.modules:3.0.0]
        at
org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.run(ConsoleFactoryService.java:107)[47:org.apache.karaf.shell.console:3.0.0]
Caused by: java.lang.Exception: Unable to start bundle mvn:com.routing/1.0.0
        at
org.apache.karaf.bundle.command.Install.doExecute(Install.java:53)
        ... 30 more
Caused by: org.osgi.framework.BundleException: Unresolved constraint in
bundle com.routing [379]: Unable to resolve 379.0: missing requirem
] osgi.wiring.package;
(osgi.wiring.package=javax.persistence.EntityManagerFactory)
        at
org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3974)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2037)
        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)
        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:942)
        at
org.apache.karaf.bundle.command.Install.doExecute(Install.java:51)
        ... 30 more

I guess I'm just one last step before the problem solution.
Please help.

Thanks.

Aryan.



--
View this message in context: http://camel.465427.n5.nabble.com/Configuring-hibernate-with-blueprint-in-karaf-tp5758588p5758658.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Configuring hibernate with blueprint in karaf

Posted by Aryan <ka...@gmail.com>.
Hi,

We also tried to use the latest karaf version(3.0.2) and using hibernate
version as 4.2.15.Final but still same issue.

Any ideas?

Thanks,
Aryan



--
View this message in context: http://camel.465427.n5.nabble.com/Configuring-hibernate-with-blueprint-in-karaf-tp5758588p5758835.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Configuring hibernate with blueprint in karaf

Posted by Artur Chyży <ar...@gmail.com>.
Hibernate 4.0.1 is not Osgified (No Osgi manifest entries in MANIFEST.MF).
Future versions like 4.3.5 are osgified. 

Just use higher version for osgi, check if someone did not osgify it already
(like servicemix team which osgifies some libraries), or use
'wrap:mvn:org.hibernate/hibernate-entitymanager/4.0.1.Final' entry instead
of normal maven. 





--
View this message in context: http://camel.465427.n5.nabble.com/Configuring-hibernate-with-blueprint-in-karaf-tp5758588p5758595.html
Sent from the Camel - Users mailing list archive at Nabble.com.