felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zaid Jamal Saeed Al Mahmoud <zaid.almahm...@kustar.ac.ae>
Subject Creating PrimitiveComponentType without importing iPOJO required Packages
Date Sat, 08 Mar 2014 11:11:52 GMT
Hey, I have the following issue:

In my OSGI bundle, I create a Component Type using iPOJO API as the following:

public void start(BundleContext context) throws Exception {


        type = new PrimitiveComponentType().setBundleContext(context)
                .setComponentTypeName("someType")
                .setClassName("my.class.Name")
                .setImmediate(true);
        type.start();

        instance = type.createInstance();



          }


Now, according to this source, http://mail-archives.apache.org/mod_mbox/felix-users/201204.mbox/%3C1FCCF246-DB56-4E86-A0EE-7E57EC96DDB7@gmail.com%3E

iPOJO manipulation rely on some classes of org.apache.felix.ipojo, and so I need to import
this package. All bundles intended to have iPOJO component, need to import: org.apache.felix.ipojo
and org.apache.felix.ipojo.architecture.



For some reason, I don't like to import these packages from my bundle. I want my bundle to
have iPOJO component without importing any iPOJO-related packages.



Although the answer in the link continues saying:



To avoid this manual import you can:

- use the iPOJO url handler and so install the bundle with: ipojo://file:/the.path.to.my.bundle.jar



I tried the above solution, by adding "ipojo://" part to my bundle installation file path
as the following,





bundleContext.installBundle("ipojo://file:C:\Users\zaid.almahmoud\Desktop\plugins\MyComponent.jar");





but when I run my program, I get the following error:




org.osgi.framework.BundleException: Unable to cache bundle: ipojo://file:C:\Users\zaid.almahmoud\Desktop\plugins\MyComponent.jar

Caused by: java.net.MalformedURLException: Unknown protocol: ipojo






What am I missing here? Thanks.


Kind Regards,
Zaid Almahmoud
Research Assistant
[cid:image001.png@01CE4FB8.E6C8A910]<http://www.ebtic.org/>
Khalifa University of Science, Technology, and Research
Abu Dhabi - United Arab Emirates
TEL: 00971-2-401-8178
MOB: 00971-50-9619601


Mime
  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message