|
Hello community; I am facing an issue concerning Felix, Split packages and Fragment bundles. Here is my use case: 1/ We have some bundles with (unfortunately) some esoteric "split packages" which are not supported by OSGI. For instance: b1.jar exports package "com.p" with com.p.C1 b2.jar exports package "com.p" with com.p.C2 and: class com.p.C1 instantiates the com.p.C2 2/ In order to solve this problem, we could incorporate b1.jar and b2.jar into one "big.jar" with "Bundle-ClassPath: b1.jar, b2.jar", but we can't dot that (for some reasons not exposed here ...). 3/ Now, I am trying to use Fragments in order to solve the split package issue. It would be great if someone could have a look to the following sample code because it does not work with Felix 1.0.1, but it works properly with Knopflerfish and Equinox ! Here is my sample code: the fraghost.jar loads a class from frag1.jar, which itself loads a class from frag2.jar ... Bundle "fraghost.jar": MANIFEST for fraghost.jar: Manifest-Version: 1.0 Class com.test.fraghost.FragHost from fraghost.jar: public class FragHost implements BundleActivator { Bundle "frag1.jar": MANIFEST for frag1.jar: Manifest-Version: 1.0 Class com/test/frag/Frag1.java from frag1.jar: public class Frag1 implements Runnable { Bundle "frag2.jar": MANIFEST for frag2.jar: Manifest-Version: 1.0 Class com/test/frag/Frag2.java from frag2.jar: public class Frag2 implements Runnable { Running these bundles with Felix 1.0.1, I have the following exception: FragHost is instantiating com.test.frag.Frag1 from frag1.jar ... ERROR: Error starting file:bundle/fraghost.jar (org.osgi.framework.BundleException: Activator start error.) java.lang.ClassNotFoundException: *** Class 'com.test.frag.Frag1' was not found. Bundle 6 does not import package 'com.test.frag', nor is the package exported by any other bundle or available from the system class loader. *** at org.apache.felix.framework.searchpolicy.R4SearchPolicyCore.findClass(R4SearchPolicyCore.java:184) at org.apache.felix.framework.searchpolicy.R4SearchPolicy.findClass(R4SearchPolicy.java:45) at org.apache.felix.framework.searchpolicy.ContentClassLoader.loadClass(ContentClassLoader.java:75) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at com.test.fraghost.FragHost.start(FragHost.java:13) at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:589) at org.apache.felix.framework.Felix._startBundle(Felix.java:1536) at org.apache.felix.framework.Felix.startBundle(Felix.java:1470) at org.apache.felix.framework.Felix.setFrameworkStartLevel(Felix.java:1065) at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:258) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.ClassNotFoundException: com.test.frag.Frag1 at org.apache.felix.framework.searchpolicy.R4SearchPolicyCore.findClassOrResource(R4SearchPolicyCore.java:412) at org.apache.felix.framework.searchpolicy.R4SearchPolicyCore.findClass(R4SearchPolicyCore.java:175) ... 10 more -> ps START LEVEL 1 ID State Level Name [ 0] [Active ] [ 0] System Bundle (1.0.1) [ 1] [Active ] [ 1] Apache Felix Shell Service (1.0.0) [ 2] [Active ] [ 1] Apache Felix Shell TUI (1.0.0) [ 3] [Active ] [ 1] osgi (4.0) [ 4] [Active ] [ 1] Frag1 [ 5] [Active ] [ 1] Frag2 [ 6] [Resolved ] [ 1] FragHost (1.0.0) Thanks for your help; Pierre. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] |
- Fragments and Split Packages Pierre De Rop
- Re: Fragments and Split Packages Achim
- Re: Fragments and Split Packages Pierre De Rop
- Re: Fragments and Split Packages stuart . mcculloch
- Re: Fragments and Split Packages Pierre De Rop
- Re: Fragments and Split Packages Karl Pauls

