Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » The "Require-Bundle" trick don't work with c3p0 pool
The "Require-Bundle" trick don't work with c3p0 pool [message #1007674] Thu, 07 February 2013 01:45 Go to next message
Anton Lem is currently offline Anton LemFriend
Messages: 11
Registered: January 2013
Junior Member
Imagine situation: I have a main WAB which uses the separated c3p0-bundle like a connection pool. WAB doesn't just use c3p0 but customises its connection by WAB's class. To work properly, c3p0-bundle class loader has to obtain this WAB's class. To open access to WAB's classes for c3p0 I wrote "Require-Bundle:" in the WAB's MANIFEST. This solution is successfully working with the hibernate bundle, but c3p0 can't find the required class.
Could not create for find ConnectionCustomizer with class name 'com.liferay.portal.dao.jdbc.pool.c3p0.PortalConnectionCustomizer'. org.eclipse.virgo.kernel.osgi.framework.ExtendedClassNotFoundException: com.liferay.portal.dao.jdbc.pool.c3p0.PortalConnectionCustomizer in KernelBundleClassLoader: []

I earlier just repacked the original c3p0-bundle to add Import of the required class package. This solution works but issues another kind of problem ( What is wrong in this situation with Require-bundle? Is there some other tricks to enforce the separated c3p0-bundle to find the required class inside main WAB?
Re: The "Require-Bundle" trick don't work with c3p0 pool [message #1007675 is a reply to message #1007674] Thu, 07 February 2013 02:27 Go to previous message
Dmitry Sklyut is currently offline Dmitry SklyutFriend
Messages: 279
Registered: January 2010
Senior Member
I think you are looking at known Class.forName() issue.

c3p0 loads ConnectionCustomizer like this:
out = (ConnectionCustomizer) Class.forName( className ).newInstance();

Rad about it here:

What you want to do is to have a separate bundle that will publish a DataSource Service object, created with help of c3p0 or Apache BDCP. In your wab you import that DataSource service and use it without having to have a RequireBundle dependency on c3p0.

Services are much better way to organize your dependencies.

Previous Topic:Running a wab on virgo nano + gemini web
Next Topic:How to get EclipseRT/Virgo option in preferences>server>runtime environments?
Goto Forum:

Current Time: Fri Nov 27 17:28:54 GMT 2015

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

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