3
votes

i just migrated from Equinox to Apache Felix. Now there is the javax.sql.datasource class missing:

java.lang.NoClassDefFoundError: javax/sql/DataSource

My bundle is importing javax.sql in the manifest file and i tried to add the following line to the felix config:

org.osgi.framework.system.packages.extra=javax.sql

Is there any way to teach felix to export the bundle or is there a bundle that does it? It worked fine in Equinox even without the import statement in the manifest.

EDIT: The manifest file:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Database
Bundle-SymbolicName: ...database
Bundle-Version: 1.0.0
Import-Package: javax.sql,
 org.osgi.framework;version="1.3.0",
 org.osgi.service.component;version="1.1.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ClassPath: lib/mysql-connector-java-5.1.20-bin.jar,
 .
Export-Package: ...database.model,
 ...database.service
Service-Component: OSGI-INF/component.xml

Thanks, Daniel

1

1 Answers

3
votes

Felix does already export this package.

More likely is that there may be something wrong with your Import-Package statement. You did state that your bundle imports the package, but please post a copy of your MANIFEST.MF to be sure.