There have been a couple of times where I've been using systems where the 
package/class that I'm trying to use is being loaded dynamically.

For example, the 'standard' way to use a JDBC driver is something like this:

String driverName = "oracle.jdbc.driver.OracleDriver";
Class.forName(driverName);

Or in the case of Jaxb and using JAXBContext with a marshaller:

      JAXBContext jaxbContext = JAXBContext.newInstance( contextName);


In both these cases I've had a really hard time forcing the bnd ant task to 
have Imports for the packages I need. Including them like this doesn't work:

Import-Package: oracle.jdbc.driver.*

Instead I've had to explicitly create a 'fake' instance of the Driver 
(literally, new oracle.jdbc.driver.OracleDriver()) so that it's included in the 
imports and then bnd seems to be able to pick it up.

There has got to be a better way. What am I missing?

________________________________

Joel Schuster
Senior Software Engineer
NAVSYS Corporation
14960 Woodcarver Road, Colorado Springs, CO 80921
719-481-4877



Reply via email to