I had the same problem and was pointed to the OSGi r4.2 draft spec. It defines a framework launching API, which has a number of launching properties. The following property exports external jars as if they are part of the framework:

org.osgi.framework.system.packages.extra

I have used it successfully with Equinox build 3.5.0.v20090311.

- Jae

On Apr 20, 2009, at 9:29 AM, David Bosschaert wrote:

Well, one thing you could do is wrap the external jar and turn it into an OSGi bundle. There's two ways to do this: 1. Update the manifest of the jar to add the OSGi metadata (Bundle- SymbolicName, Import-Package, Export-Package etc) 2. Wrap the jar as-is on another bundle jar that has the OSGi metadata and a Bundle-Classpath header pointing to the embedded jar.

Option 1 has the benefit that the jar is also still an ordinary jar that could potentially be used outside of OSGi (this is sometimes desired). Option 2 has the benefit that you don't need to modify the original, as it is embedded as-is in a new jar. In both cases the resulting bundle is fully OSGi compliant and will work with any OSGi container. The BND tool from Peter Kriens (and its mavenized version the maven- bundle-plugin) will help you create these.

David

Thomas Watson wrote:

There is no standard way to reference an external jar from a bundle. In OSGi, bundles can only satisfy their code dependencies by import-package/require-bundle constraints or with their own private content. There is an Equinox specific way to do this but it greatly breaks the notion of modularity. You should ask such questions on the equinox newsgroup.

Tom



Inactive hide details for ratno Kustiawan ---04/19/2009 09:12:19 PM---Can you help me?? How to reference external jar from our ratno Kustiawan ---04/19/2009 09:12:19 PM---Can you help me?? How to reference external jar from our bundles??? I am using Equinox


From:   
ratno Kustiawan <[email protected]>

To:     
[email protected]

Date:   
04/19/2009 09:12 PM

Subject:        
[osgi-dev] Re: osgi-dev Digest, Vol 30, Issue 18

------------------------------------------------------------------------



Can you help me??
How to reference external jar from our bundles??? I am using Equinox

On Sun, Apr 19, 2009 at 11:00 PM, <[email protected]_ <mailto:[email protected]>> wrote:

     Send osgi-dev mailing list submissions to
            [email protected]_ <mailto:[email protected]>

     To subscribe or unsubscribe via the World Wide Web, visit
            _https://mail.osgi.org/mailman/listinfo/osgi-dev_
     or, via email, send a message with subject or body 'help' to
            [email protected]_
     <mailto:[email protected]>

     You can reach the person managing the list at
            [email protected]_
     <mailto:[email protected]>

When replying, please edit your Subject line so it is more specific
     than "Re: Contents of osgi-dev digest..."


     Today's Topics:

       1. Ahmed A Saleh is out of the office. (Ahmed A Saleh)


----------------------------------------------------------------------

     Message: 1
     Date: Sat, 18 Apr 2009 20:02:44 +0200
     From: Ahmed A Saleh <[email protected]_
     <mailto:[email protected]>>
     Subject: [osgi-dev] Ahmed A Saleh is out of the office.
     To: [email protected]_ <mailto:[email protected]>
     Message-ID:
                 
<_of75578d60.ee3cd691-onc225759c.006320c3-c225759c.00632...@eg.ibm.com_
<mailto:of75578d60.ee3cd691-onc225759c.006320c3-c225759c.00632...@eg.ibm.com >>
     Content-Type: text/plain; charset=US-ASCII


     I will be out of the office starting  04/16/2009 and will not
     return until
     04/21/2009.




     ------------------------------

     _______________________________________________
     OSGi Developer Mail List_
     [email protected]_ <mailto:[email protected]>_
     __https://mail.osgi.org/mailman/listinfo/osgi-dev_

     End of osgi-dev Digest, Vol 30, Issue 18
     ****************************************
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

------------------------------------------------------------------------

_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev


_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to