Hibernate, JDBC driver and OSGi problem

I ran into a somewhat depressing problem. I use Apache Felix as my OSGi platform, and Im also uses Hibernate for persistence issues.

Im using the "osgi-bundle" version of Hibernate (com.springsource.org.hibernate-3.2.6.ga.jar). As far as I know, this is Hibernate Core with some additional osgi-metdata installed in META-INF / MANIFEST.mf. This information (Package-Export and Package-Import) is vital for osgi systems.

My problem is that Hibernate cannot find my JDBC drivers. It is very difficult to add Import statements to the Hibernate springsource package. There must be a better way to solve this problem.

+5
source share
5 answers

I ran into a similar problem a while ago. The solution was to register the jdbc-provider and jdbc-user bundles packages as buddies. This is because one package cannot use classes (therefore jdbc drivers too) from another without explicitly declaring it. This was for Eclipse, so I guess it might help you.

+1
source

Hibernation is not a good OSGi citizen, since many of the assumptions that Hibernate makes for class visibility are no longer true in the OSGi container.

JDBC- Class.forName(<jdbc class name>) OSGi, Hibernate , Hibernate ( ) JDBC.

JDBC , , , OSGi.

Spring Hibernate, SimpleDriverDataSource, OSGi, Spring Hibernate , , Hibernate .

, , , Hibernate, . XML-, , OSGi, , - OSGi.

, - Spring dm Server, Java OSGi Java OSGi.

, , . Spring dm OSGi, .

+7

? , . , . , .

, . JDBC .

, . , . , OSGi . Equinox -console "ss", "diag" OSGi.

EDIT ( ):

. Hibernate , , , . , .

+3

OSGi . Hibernate ( ) . , Hibernate XML, , , ( ).

, Equinox, , , Hibernate. , , () , .

, , , , Hibernate.

+3

( -RDBMS , , -ORM), OSGi.

, , Hibernate . .

, JDBC, . OSGi Hibernate . , Hibernate.

, Felix 9 , , , : http://osgithoughts.blogspot.com/2009/09/felix-now-fully-supports-osgi-fragments.html

+1

All Articles