You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Mahammad Nasir <ma...@huawei.com> on 2010/07/10 17:44:54 UTC

Sharing the jar files across all the application

Hi,
 
I have 5-6 non osgi jar files (Not budle). And i have many application
bundles which uses this jar file. I want to know what is the best way to
share these jar files acros all the applications.
 
I can think of,
 
1) collect all the jar files and make this one bundle and load this in osgi
and other applications can now access it. (But, for some reason i dont want
to do this)
2) add the jars to class path of all the bundle. Problem with this is if a
jar files is changed. i have to modify all the application and manifest.
 
 
Is there any other better way of doing this? does osgi allow 2 dofferent
version of non-osgi jar files to load by two diffrent application?
 
 
Thanks Nasir

Re: Sharing the jar files across all the application

Posted by Guo Du <mr...@duguo.org>.
On Sun, Jul 11, 2010 at 7:03 AM, Mahammad Nasir 00900514
<ma...@huawei.com> wrote:
> Can you tell me what could be the problems if i dont make it as a bundle?
>
> Currently i am using the second method which is working fine, i am not able to anticipate the problem now.
What do you want to share for those jars? If it's just resource files,
you may put at a shared location for all bundles to access. You should
use bundle if mainly for class sharing, that what OSGi about.

You can also have your own class loader and expose as service for your
OSGi environment to access the jar file as a workaround.

-Guo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Sharing the jar files across all the application

Posted by Mahammad Nasir 00900514 <ma...@huawei.com>.
Can you tell me what could be the problems if i dont make it as a bundle?

Currently i am using the second method which is working fine, i am not able to anticipate the problem now. 

I can think of 3 method,

Make the jars available to classloader of osgi launcher. (I am launching felix programatically/embedding felix). Then make the boot delegation true.

Can any one tell me which is the better way of doing this and why? is there any other ways?

******************************************************************************************
 This email and its attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained here in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this email in error, please notify the sender by phone or email immediately and delete it!
 *****************************************************************************************

----- Original Message -----
From: Justin Edelson <ju...@gmail.com>
Date: Saturday, July 10, 2010 11:47 am
Subject: Re: Sharing the jar files across all the application
To: users@felix.apache.org

> You should make bundles out of these JAR files. Otherwise, you are 
> justfighting OSGi.
> 
> On 7/10/10 11:44 AM, Mahammad Nasir wrote:
> > Hi,
> >  
> > I have 5-6 non osgi jar files (Not budle). And i have many 
> application> bundles which uses this jar file. I want to know what 
> is the best way to
> > share these jar files acros all the applications.
> >  
> > I can think of,
> >  
> > 1) collect all the jar files and make this one bundle and load 
> this in osgi
> > and other applications can now access it. (But, for some reason 
> i dont want
> > to do this)
> > 2) add the jars to class path of all the bundle. Problem with 
> this is if a
> > jar files is changed. i have to modify all the application and 
> manifest.>  
> >  
> > Is there any other better way of doing this? does osgi allow 2 
> dofferent> version of non-osgi jar files to load by two diffrent 
> application?>  
> >  
> > Thanks Nasir
> > 
> 
> 
> -------------------------------------------------------------------
> --
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Sharing the jar files across all the application

Posted by Justin Edelson <ju...@gmail.com>.
You should make bundles out of these JAR files. Otherwise, you are just
fighting OSGi.

On 7/10/10 11:44 AM, Mahammad Nasir wrote:
> Hi,
>  
> I have 5-6 non osgi jar files (Not budle). And i have many application
> bundles which uses this jar file. I want to know what is the best way to
> share these jar files acros all the applications.
>  
> I can think of,
>  
> 1) collect all the jar files and make this one bundle and load this in osgi
> and other applications can now access it. (But, for some reason i dont want
> to do this)
> 2) add the jars to class path of all the bundle. Problem with this is if a
> jar files is changed. i have to modify all the application and manifest.
>  
>  
> Is there any other better way of doing this? does osgi allow 2 dofferent
> version of non-osgi jar files to load by two diffrent application?
>  
>  
> Thanks Nasir
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org