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.

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.

* 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...



One answer

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

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

* 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



Your answer

Register or to post your answer.