I suppose I should at least point out that this works perfectly fine in equinox (3.3) and I suppose I should also include my bundle manifests:
Bundle A: Manifest-Version: 1.0 Bundle-Description: Test A Bundle Bundle-Name: A Private-Package: com.mqsoftware.test.A.impl Created-By: 1.5.0_11 (Sun Microsystems Inc.) Import-Package: com.mqsoftware.test.A,com.mqsoftware.test.A.impl,javax .naming,javax.naming.spi Bundle-ManifestVersion: 2 Bundle-SymbolicName: com.mqsoftware.test.A Tool: Bnd-0.0.160 Bnd-LastModified: 1185909339057 Export-Package: com.mqsoftware.test.A,com.mqsoftware.test.A.impl;uses: ="javax.naming,javax.naming.spi" Bundle-Version: 1.0.0.SNAPSHOT Bundle B: Manifest-Version: 1.0 Created-By: 1.5.0_11 (Sun Microsystems Inc.) Bundle-Activator: com.mqsoftware.test.B.Activator Import-Package: com.mqsoftware.test.A,javax.naming,org.osgi.framework; version=1.3 Bnd-LastModified: 1185909342510 Bundle-Version: 1.0.0.SNAPSHOT Bundle-Name: B Bundle-Description: Test B Bundle Private-Package: com.mqsoftware.test.B Bundle-ManifestVersion: 2 Bundle-SymbolicName: com.mqsoftware.test.B Tool: Bnd-0.0.160 DynamicImport-Package: com.mqsoftware.test.A.impl -----Original Message----- From: Craig L. Ching [mailto:[EMAIL PROTECTED] Sent: Tue 7/31/2007 2:25 PM To: [email protected]; [email protected] Subject: RE: Maven-bundle-plugin and DynamicImport-Package support? Well, I'm not sure if this is a defect in felix or not, so, before I go opening an issue for this, I'd like to present what I found. I created two bundles, A and B. In A, I have a class (com.mqsoftware.test.A.impl.Aimpl) that implements javax.naming.spi.InitialContextFactory. Bundle B then does this in its activator: public void start(BundleContext context) throws Exception { System.out.println("Starting B ..."); Hashtable<String, String> env = new Hashtable<String, String>(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.mqsoftware.test.A.impl.Aimpl"); env.put(Context.PROVIDER_URL, "localhost"); InitialContext ctx = new InitialContext(env); System.out.println("B Started."); } and when I start bundle B, I get this: DEBUG: WIRE: 29.0 -> javax.naming -> 0 DEBUG: WIRE: 29.0 -> com.mqsoftware.test.A -> 28.0 DEBUG: WIRE: 29.0 -> org.osgi.framework -> 0 Starting B ... Starting B ... javax.naming.NoInitialContextException: Cannot instantiate class: com.mqsoftware.test.A.impl.Aimpl [Root exception is java.lang.ClassNotFoundException: com.mqsoftware.test.A.impl.Aimpl] This error is slightly different than my real error in that the real error gives me a full stack trace. One other odd thing is the "Starting B..." twice. "Starting B..." is printed out in bundle B's activator. I have a maven project that is completely self-contained (apart from some felix-osgi dependencies) if anyone thinks this is a problem in felix. My felix version is the trunk from a couple of days ago. Cheers, Craig -----Original Message----- From: Craig L. Ching [mailto:[EMAIL PROTECTED] Sent: Mon 7/30/2007 2:37 PM To: [email protected] Subject: RE: Maven-bundle-plugin and DynamicImport-Package support? Well, my bundle *is* working in equinox, I'll try simplifying it down to where it works in equinox but not in felix. Cheers, Craig > -----Original Message----- > From: Craig L. Ching [mailto:[EMAIL PROTECTED] > Sent: Monday, July 30, 2007 1:59 PM > To: [email protected] > Subject: RE: Maven-bundle-plugin and DynamicImport-Package support? > > Well, I should have just tried this out before posting ;-) > The doc doesn't say you can do it, but you apparently can use > DynamicImport-Package. > > But, that said, it's still not working, I'm getting a > ClassNotFoundException, anyone have any experience doing this > and might suggest how I track down what's wrong? > > Thanks for any help! > > Cheers, > Craig > > > -----Original Message----- > > From: Craig L. Ching [mailto:[EMAIL PROTECTED] > > Sent: Monday, July 30, 2007 1:53 PM > > To: [email protected] > > Subject: Maven-bundle-plugin and DynamicImport-Package support? > > > > Hi all, > > > > I apparently have a need to use DynamicImport-Package > (Jackrabbit is > > doing the equivalent of Class.forName() under the covers), > but I can't > > find any doc that says BND supports this. Is there a > work-around if > > it doesn't? I've tried simply adding what I needed to the > > Import-Package, but I get a warning from BND that I never use that > > import and I get ClassNotFoundException at runtime. Any help is > > appreciated, in the meantime I'm going to manually add > > DynamicImport-Package to the bundle and see if that helps. > > > > Cheers, > > Craig > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

