Ops, sorry. It was a mistake in the example. It was because maven-bundle-plugin don't add not exporting package in to the bundle archive. You must delete Export-Package directive from bundle2/osgi.bnd and rebuild and rerun it. Or there is a fixed version in attachment. For now classes in second bundle in org.foo are present, but bundle2 still can't find org.foo.ExampleService2 and I have this response: java.lang.NoClassDefFoundError: *** Package 'org.foo' is imported by bundle 2 from bundle 1, but the exported package from bundle 1 does not contain the requested class 'org.foo.ExampleService2'. Please verify that the class name is correct in the importing bundle 2 and/or that the exported package is correctly bundled in 1. *** But class org.foo.ExampleService2 presented in bundle2
2008/4/11, Karl Pauls <[EMAIL PROTECTED]>: > You don't include the org.foo package inside your second bundle (i.e., > there are no classes in the org/foo dir). That is why you can't find > the classes. > > Felix and Kf's behaviour is the correct one. Since the bundle that > exports the package actually doesn't have anything to export the > classes can not be found. It probably only works on Equinox because > they do bootdelegate to the classpath by default (which is bad). Just > make sure your bundle contains the org.foo package and it should work. > > regards, > > Karl > > > On Fri, Apr 11, 2008 at 2:55 PM, Sergey Parilin <[EMAIL PROTECTED]> wrote: > > Thanks for the quick answer. > > > > Here they are. > > > > This is the first: > > > > Manifest-Version: 1.0 > > Export-Package: org.foo;version="1.0.0.SNAPSHOT" > > Private-Package: org.foo.internal > > Ignore-Package: org.foo.internal > > Built-By: sap > > Tool: Bnd-0.0.227 > > Bundle-Name: org.foo.test-osgi.bundle1 [org.foo] > > Created-By: Apache Maven Bundle Plugin > > Build-Jdk: 1.6.0_03 > > Bundle-Version: 1.0.0.SNAPSHOT > > Bnd-LastModified: 1207917736196 > > Bundle-ManifestVersion: 2 > > Bundle-Activator: org.foo.internal.ExampleActivator1 > > Bundle-Description: Generated using Pax-Construct v2 > > Import-Package: org.foo;version="1.0.0.SNAPSHOT",org.osgi.framework > > Bundle-SymbolicName: org.foo.test-osgi.bundle1 > > > > This is the second: > > > > Manifest-Version: 1.0 > > Private-Package: org.foo.internal > > Ignore-Package: org.foo.internal > > Built-By: sap > > Tool: Bnd-0.0.227 > > Bundle-Name: org.foo.test-osgi.bundle2 [org.foo] > > Created-By: Apache Maven Bundle Plugin > > Build-Jdk: 1.6.0_03 > > Bundle-Version: 1.0.0.SNAPSHOT > > Bnd-LastModified: 1207917736734 > > Bundle-ManifestVersion: 2 > > Bundle-Activator: org.foo.internal.ExampleActivator2 > > Bundle-Description: Generated using Pax-Construct v2 > > Import-Package: org.foo;version="1.0.0.SNAPSHOT",org.osgi.framework > > Bundle-SymbolicName: org.foo.test-osgi.bundle2 > > > > Also, I have attached my example as an archive. > > You can extract it. Build and execute with maven2. > > mvn clean install > > mvn -Dframework=felix pax:provision > > or > > mvn -Dframework=equinox pax:provision > > > > to feel a difference. > > > > 2008/4/11, Marcel Offermans <[EMAIL PROTECTED]>: > > > > > > > On Apr 11, 2008, at 13:13 , Sergey Parilin wrote: > > > > > > > > > > I have two bundles (A and B). Bundle A have package org.foo and > > > > imports it. > > > > > > > > > > Could you please show us both manifests, because I'm not sure I > completely > > > understand your story. > > > > > > Greetings, Marcel > > > > > > > > > > > > > -- > Karl Pauls > [EMAIL PROTECTED] >
test-osgi.tar.gz
Description: GNU Zip compressed data
