Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Eclipse & Datanucleus - OSGI problem?(Help implementing PoolManager (BoneCP,Proxool,C3P0 or DBCP))
icon5.gif  Eclipse & Datanucleus - OSGI problem? [message #631903] Sun, 10 October 2010 11:41 Go to next message
Marco Lopes is currently offline Marco LopesFriend
Messages: 61
Registered: September 2010
Member
Datanucleus supports some pool manager options:

http://www.datanucleus.org/products/accessplatform_2_2/rdbms /connection_pooling.html
DBCP plugin
C3P0 plugin
Proxool plugin

And recently
BoneCP plugin

I've tried EVERYONE of them, with NO success, because of OSGI?? (i'm under ECLIPSE RCP)

The closest i've been to succeed was with DBCP, but i had to implement a MANUAL initialization of DBCP, and could not start Datanucleus with the required parameters...

So, what happens?

The JARs are on the classpath, but the classes are not loaded.

Caused by: java.lang.ClassNotFoundException: com.jolbox.bonecp.BoneCPConfig at org.eclipse.osgi.internal.loader.BundleLoader.findClassInter nal(BundleLoader.java:506) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:422) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:410) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(Unknown Source)

ANYONE here implemented a Poolmanager UNDER ECLIPSE RCP and Datanucleus?

Thanks a lot.
Re: Eclipse & Datanucleus - OSGI problem? [message #632080 is a reply to message #631903] Mon, 11 October 2010 13:43 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
In OSGi each bundle must specify their requirements. What packages do they import (with Import-Package) or what bundles they require (with Require-Bundle). They also must specify what packages they want to allow other bundles to have access to (Export-Package). In most cases where a class not found exception is thrown in OSGi it is because of a missing constraint specification in the bundle's OSGi manifest (META-INF/MANIFEST.MF).

Does the bundle loading the com.jolbox.bonecp.BoneCPConfig class have an Import-Package statement for the com.jolbox.bonecp package? Does another bundle export that package?

HTH

Tom.
Re: Eclipse & Datanucleus - OSGI problem? [message #632186 is a reply to message #632080] Tue, 12 October 2010 00:43 Go to previous message
Marco Lopes is currently offline Marco LopesFriend
Messages: 61
Registered: September 2010
Member
Response from BoneCP:

This is what bonecp exports:

Export-Package: com.jolbox.bonecp;uses:="com.google.common.base,com.jo
lbox.bonecp.proxy,javax.management,org.slf4j,javax.sql,com.j olbox.bon
ecp.hooks,jsr166y,javax.xml.parsers,org.w3c.dom,javax.naming ,javax.na
ming.spi,com.google.common.collect",com.jolbox.bonecp.hooks;uses:= "co
m.jolbox.bonecp,org.slf4j",com.jolbox.bonecp.proxy,jsr166y;uses:= "sun
.misc"

Response from DataNucleus:

As has been said before (more than once), any jar you put in an OSGI env has to have that manifest, and you haven't put an OSGi-ified BoneCP/C3P0/DBCP jar in the OSGi container - you've used the "normal" jar. So when a DN OSGi bundle tries to find the import that it requires it can't find it ... since you haven't provided it. So do as that person said and check the manifests of the jars you're using. The DN jars all have the right ImportPackage lines.

Spring provide bundles of many software products with such manifests included, or you repackage the bonecp/c3p0/dbcp jar(s) putting manifests in with the right ExportPackage statements as told.

:-\

[Updated on: Tue, 12 October 2010 00:44]

Report message to a moderator

Previous Topic:Source code for "osgi.clean" option
Next Topic:Bad projects in Eclipse
Goto Forum:
  


Current Time: Fri Mar 29 00:10:15 GMT 2024

Powered by FUDForum. Page generated in 0.02921 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top