-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: hibernate Osgi issue
PostPosted: Mon May 03, 2010 6:20 am 
Newbie

Joined: Mon May 03, 2010 6:14 am
Posts: 2
hi ,

I am trying a hibernate connection with an OSGI bundle , I am deploying the bundle in eclipse using EQUINOX ..
While doing the same I am facing the error:


at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:805)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:754)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:352)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:280)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:272)
at org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java:253)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:155)
at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:303)
at org.eclipse.osgi.framework.internal.core.FrameworkConsole.console(FrameworkConsole.java:288)
at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:224)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at com.zaloni.redcore.plugin.solr_monitor.AddressInsertion.connector(AddressInsertion.java:40)
at com.zaloni.redcore.plugin.solr_monitor.Activator.start(Activator.java:25)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:782)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:773)
... 14 more
Caused by: java.lang.ClassNotFoundException: org.dom4j.DocumentException
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:489)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:405)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:393)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105)
at java.lang.ClassLoader.loadClass(Unknown Source)


Top
 Profile  
 
 Post subject: Re: hibernate Osgi issue
PostPosted: Mon May 03, 2010 7:39 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
The third library dom4j<-version>.jar is missing in your classpath.
This jar is usually contained in the hibernate distribution under the directory lib/required


Top
 Profile  
 
 Post subject: Re: hibernate Osgi issue
PostPosted: Mon May 03, 2010 7:45 am 
Newbie

Joined: Mon May 03, 2010 6:14 am
Posts: 2
I have already put the dom4 jar in the bundle class path even then the error persists .


Top
 Profile  
 
 Post subject: Re: hibernate Osgi issue
PostPosted: Mon May 03, 2010 7:59 am 
Newbie

Joined: Fri Apr 30, 2010 9:00 am
Posts: 3
Hi all ,
I am trying to run hibernate in osgi container, but its not running . Please suggest me how i can run hibernate in osgi container.

Thanks in Advance


Top
 Profile  
 
 Post subject: Re: hibernate Osgi issue
PostPosted: Sun May 16, 2010 10:15 am 
Newbie

Joined: Fri Jun 12, 2009 11:02 am
Posts: 2
I think it's safe to say that Hibernate is currently incompatible with OSGi. I see at least two reasons:

  • Hibernate uses the thread context classloader, a concept that does not work* in OSGi environments. The Apache Felix mailing list contains many topics like "Library X doesn't work in OSGi" and almost every time it's that drat thread context classloader.
  • In a hypothetical Hibernate bundle, the DriverManager would use the bundle's class loader to load JDBC drivers, which means that the Hibernate bundle would have to "import-package" the driver packages. Ugly.

*Equinox and Spring-DM try to work around this issue


I think our best bet is to plead with the Hibernate developers for "osgification" of our favorite ORM library. ;-)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.