Did you remember the catch-all "*" at the end of the import-package statement?
-- Neil Bartlett Sent from a phone On Friday, 2 November 2012 at 17:19, Christopher BROWN wrote: > Hello, > > Using current builds of BND (GitHub/Cloudbees), and referring to the > documentation for BND, I'm observing odd behavior. > > It seems that BND only adds "javax" packages automatically to the > MANIFEST.MF when the ".bnd" file contains NO "Import-Package" directive. > However, I need to add explicit headers because BND can't guess the > version ranges, so I add the headers manually with the version ranges. And > suddenly, BND doesn't seem to detect and add the "javax" packages any more. > > Therefore, I'm getting ClassNotFoundExceptions from Apache Felix at runtime > (with the helpful message telling me that the JDK and Felix export it) > because there's no Import-Package header. This is similar to "classic" > classpath problems in Java in that the failure occurs only when a specific > code path is executed... > > I can test this by adding a dummy line such as: > javax.sql.DataSource = null; > > ...anywhere in the bundle. This only fails when the JVM reaches this code, > it doesn't prevent the bundle loading. Apache Felix obviously can't detect > the problem when resolving the bundle because it's not explicitly imported, > because BND isn't adding it. > > However, if I put say "javax.foobar.*" in my directive, BND gives me a > warning. > > Is this a bug in BND ? Is there a way to make it "grumpy" so that it'll > refuse to build my bundle if my imports are wrong? > > Thanks, > Christopher > >

