views:

56

answers:

1

I wrap my project in OSGi bundle(just call my first start method from Activator.start()). In my project I use ORM ActiveObjects and c3p0 pool. All of project dependencies (jar librarys) are in class path. If I run my project with c3p0 it is takes about 5 minutes to 1 query to DB. Without c3p0 it is works correctly. In what is a problem? Thanks a lot!

A: 

Maybe your issue is related to OSGi specific class loading mechanism. In OSGi your dependencies libraries must not be in the flat java classpath but in the bundle classpath. To do that we usually create a bundle version for each library exposing the library jar as OSGi "packages".

Manuel Selva
Maybe you are right. Can you explain me how can i do it? Thanks!
EK
This depends on the OSGi runtime you are using. But the main Idea is to create an OSGi bundle including the library jar file. Then add this file to the bundle classpath and export the packages you want to export from the jar file using the Bundle manifest. This kind of "library" bundle doesn't contain any source code but just "wrap" a jar library in a bundle.
Manuel Selva