It's all about the answers!

Ask a question

ClassNotFoundException when using JDBC inside a Followup Act


Stefan Hufnagl (29411920) | asked Jan 31 '11, 7:34 a.m.
Hello,

I have to use JDBC inside a FollowUp Action, because I have to reuse a existent JDBC Oracle implementatin from Plain Java.

When the Server Side FollowUp Action triggers my OperationParticipant I use Class.forName(...) and get a ClassNotFoundException.

I tried to include the JDBC Jar File inside my Service Plugins and changed the Build Path.

Questions:
* The "Server Side FollowUp Action Plugin" is a OSGi Bundle?
* If yes, the OSGi Classloader seems to have problems.
* Should I create an other OSGi Bundle, only with the JDBC Driver?
* Then, I could include a Dependency to this JDBC Bundle?

Please don't say that the usage of JDBC is not recommented...

Thanks

Stefan

One answer



permanent link
Stefan Hufnagl (29411920) | answered Feb 01 '11, 4:44 a.m.
Hi,

tests with MySQL showed me that putting the JDBC inside a OSGi Bundle is successful.

Solution:
* Create a new PlugIn Project "Plugin from a existend Jar Archive"
* Include this Project into your plugin.xml (Dependencies -Required Plugins)
* Now you can use JDBC like in a Plain Java Program. No ClassNotFound
Exceptions!

Thanks

Stefan

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.