Re: [osgi-dev] wrapping osgi dependencies

2017-03-02 Thread Peter Kriens
When you talk about libraries are you talking about native libraries (i.e. DLL, 
.so) or just about Java JAR libraries?

I suggest enRoute because reading your mail I think you have little experience 
with OSGi. Doing the enRoute tutorials will give you grasp of the terminology 
and concepts. Since everything works out of the box you do not spend a lot of 
time figuring out very basic things. Once you’re there you can throw away the 
parts you don’t like and add the parts you need. It is a lot easier to get 
started with a working system then trying to build that up from scratch.

Kind regards,

Peter Kriens

> On 2 Mar 2017, at 10:13, Mestiri Meher  wrote:
> 
> Thanks Peter for your answser,
> 
> But does the enRoute way resolves the way of shared libraries between bundles 
> ?? 
> 
> If I'm going to need in my project lot of bundles and all of them need 
> library ('A' + 'B')  which is the best way to expose those libraries (as 
> bundles) to all the other bundles living in the osgi context ?
> 
> Thanks in advance
> 
> 2017-03-02 10:07 GMT+01:00 Peter Kriens  >:
> Did you follow the tutorials on OSGi enRoute site? http://enroute.osgi.org 
> ?
> 
> Wrapping is nowadays not that necessary anymore as it used to be. For many 
> unwrapped libraries there are good alternatives that are OSGi. Wrapping is a 
> complicated thing to do because the consequences of using OSGi sometimes go 
> further than just the manifest headers.
> 
> If you start with OSGi enRoute you can get up and working quickly after which 
> you can modify your working setup to suit your needs. For example, logging 
> with SLF 4J is setup out of the box.
> 
> Kind regards,
> 
> Peter Kriens
> 
> > On 2 Mar 2017, at 09:42, Mestiri Meher  > > wrote:
> >
> > Hello guys,
> >
> > I have another rookie question about osgi.
> >
> > I'm creating an osgi project with multiple bundles.
> >
> > I want to put all the same and shared dependencies of these bundles in a 
> > service registry or anywhere in Felix context so all bundles can use these 
> > shared libraries.
> >
> > What I understood is I have to having them as bundles too, so I found the 
> > maven plugin that helps in wrapping those depepndencies into bundles.
> >
> > Correct me if I'm wrong but I think the steps are the following :
> >
> > 1/ wrap the dependencies into wrappes.
> > 2/ install them as bundles into the felix.
> > 3/ make those bundles start oncethe felix starts.
> >
> >
> > Following this I'm having an issue with an sl4j logger dependency : 
> > "slf4j.simple_1.6.1.jar"
> > and the error is that I can not start the bundle..
> >
> > "org.osgi.framework.BundleException: Fragment bundles can not be started."
> >
> > Could you please let me know if I'm following the right scenario and if you 
> > have an idea on how I could resolve the slf4j dependency.
> >
> > Kind Regards,
> > Meher
> > ___
> > OSGi Developer Mail List
> > osgi-dev@mail.osgi.org 
> > https://mail.osgi.org/mailman/listinfo/osgi-dev 
> > 
> 
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org 
> https://mail.osgi.org/mailman/listinfo/osgi-dev 
> 
> 
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] wrapping osgi dependencies

2017-03-02 Thread Francisco Olarte
Mestiri: ( or is it Meher? cannot distinguish from address )

On Thu, Mar 2, 2017 at 10:47 AM, Mestiri Meher  wrote:
> So what I'm going to check is creating an osgi enRoute project where I'm
> going to put only the slf4j and other shared dependencies without source
> code and will try to export it.

I have not been able to check enRoute and wether it has special need.
But IIRC sfl4j stuff are proper bundles, and you just need to drop
install them, and they even have some bridge to send osgi log to them
( although that may need to star some bundle, as logging is a service,
not a class, in osgi ).

Francisco Olarte.
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev


Re: [osgi-dev] wrapping osgi dependencies

2017-03-02 Thread Mestiri Meher
Thanks Francisco for your your answer,

So what I'm going to check is creating an osgi enRoute project where I'm
going to put only the slf4j and other shared dependencies without source
code and will try to export it.
Will update in here with my findings.
Thanks

2017-03-02 10:37 GMT+01:00 Francisco Olarte :

> Mestiri:
>
> On Thu, Mar 2, 2017 at 10:13 AM, Mestiri Meher 
> wrote:
> > But does the enRoute way resolves the way of shared libraries between
> > bundles ??
> >
> > If I'm going to need in my project lot of bundles and all of them need
> > library ('A' + 'B')  which is the best way to expose those libraries (as
> > bundles) to all the other bundles living in the osgi context ?
>
> I do not know about enRoute specifically. But in OSGi if you have,
> let's say A.jar with package p.a and B.jar which uses p.a and has p.b
> you just export p.a from A, import p.a in B, export p.b from B ( in
> the manifests, using the wrapping process ( In my code I specifically
> build of my libs as bundles, as bundles can be used as plain jars in
> other code, like wars ) ), and then install then in the server. You do
> not start them, you start active bundles, bundles which do things,
> like provide services. If you just need something similar to 'copy
> them in the classpath' you just install them and, if the manifest is
> correct, the server will find them.
>
> Francisco Olarte.
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev
>
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] wrapping osgi dependencies

2017-03-02 Thread Francisco Olarte
Mestiri:

On Thu, Mar 2, 2017 at 10:13 AM, Mestiri Meher  wrote:
> But does the enRoute way resolves the way of shared libraries between
> bundles ??
>
> If I'm going to need in my project lot of bundles and all of them need
> library ('A' + 'B')  which is the best way to expose those libraries (as
> bundles) to all the other bundles living in the osgi context ?

I do not know about enRoute specifically. But in OSGi if you have,
let's say A.jar with package p.a and B.jar which uses p.a and has p.b
you just export p.a from A, import p.a in B, export p.b from B ( in
the manifests, using the wrapping process ( In my code I specifically
build of my libs as bundles, as bundles can be used as plain jars in
other code, like wars ) ), and then install then in the server. You do
not start them, you start active bundles, bundles which do things,
like provide services. If you just need something similar to 'copy
them in the classpath' you just install them and, if the manifest is
correct, the server will find them.

Francisco Olarte.
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev


Re: [osgi-dev] wrapping osgi dependencies

2017-03-02 Thread Francisco Olarte
On Thu, Mar 2, 2017 at 9:42 AM, Mestiri Meher  wrote:
> Correct me if I'm wrong but I think the steps are the following :
>
> 1/ wrap the dependencies into wrappes.
> 2/ install them as bundles into the felix.
> 3/ make those bundles start oncethe felix starts.
> Following this I'm having an issue with an sl4j logger dependency :
> "slf4j.simple_1.6.1.jar"
> and the error is that I can not start the bundle..
> "org.osgi.framework.BundleException: Fragment bundles can not be started."

I do not know about sfl4j. But you have step 3 incorrect, you do not
have to start every bundle, just install them. If you have a bundle
which just provide some code you just install it, and the server will
resolve and use it when other started bundle needs it. And,
specifically, you do not start fragments, you start ( if needed ) the
host.

> Could you please let me know if I'm following the right scenario and if you
> have an idea on how I could resolve the slf4j dependency.

Try to just install it without starting. For debugging I some times
RESOLVE them after instaling ( just to force any resolution errors
there instead of delaying them, as they normally indicate missing
dependencies and those are easier to deal with when you are in the
install-bundles-mindset.

Francisco Olarte.
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev


Re: [osgi-dev] wrapping osgi dependencies

2017-03-02 Thread Mestiri Meher
Thanks Peter for your answser,

But does the enRoute way resolves the way of shared libraries between
bundles ??

If I'm going to need in my project lot of bundles and all of them need
library ('A' + 'B')  which is the best way to expose those libraries (as
bundles) to all the other bundles living in the osgi context ?

Thanks in advance

2017-03-02 10:07 GMT+01:00 Peter Kriens :

> Did you follow the tutorials on OSGi enRoute site? http://enroute.osgi.org
> ?
>
> Wrapping is nowadays not that necessary anymore as it used to be. For many
> unwrapped libraries there are good alternatives that are OSGi. Wrapping is
> a complicated thing to do because the consequences of using OSGi sometimes
> go further than just the manifest headers.
>
> If you start with OSGi enRoute you can get up and working quickly after
> which you can modify your working setup to suit your needs. For example,
> logging with SLF 4J is setup out of the box.
>
> Kind regards,
>
> Peter Kriens
>
> > On 2 Mar 2017, at 09:42, Mestiri Meher  wrote:
> >
> > Hello guys,
> >
> > I have another rookie question about osgi.
> >
> > I'm creating an osgi project with multiple bundles.
> >
> > I want to put all the same and shared dependencies of these bundles in a
> service registry or anywhere in Felix context so all bundles can use these
> shared libraries.
> >
> > What I understood is I have to having them as bundles too, so I found
> the maven plugin that helps in wrapping those depepndencies into bundles.
> >
> > Correct me if I'm wrong but I think the steps are the following :
> >
> > 1/ wrap the dependencies into wrappes.
> > 2/ install them as bundles into the felix.
> > 3/ make those bundles start oncethe felix starts.
> >
> >
> > Following this I'm having an issue with an sl4j logger dependency :
> "slf4j.simple_1.6.1.jar"
> > and the error is that I can not start the bundle..
> >
> > "org.osgi.framework.BundleException: Fragment bundles can not be
> started."
> >
> > Could you please let me know if I'm following the right scenario and if
> you have an idea on how I could resolve the slf4j dependency.
> >
> > Kind Regards,
> > Meher
> > ___
> > OSGi Developer Mail List
> > osgi-dev@mail.osgi.org
> > https://mail.osgi.org/mailman/listinfo/osgi-dev
>
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev
>
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] wrapping osgi dependencies

2017-03-02 Thread Peter Kriens
Did you follow the tutorials on OSGi enRoute site? http://enroute.osgi.org?

Wrapping is nowadays not that necessary anymore as it used to be. For many 
unwrapped libraries there are good alternatives that are OSGi. Wrapping is a 
complicated thing to do because the consequences of using OSGi sometimes go 
further than just the manifest headers.

If you start with OSGi enRoute you can get up and working quickly after which 
you can modify your working setup to suit your needs. For example, logging with 
SLF 4J is setup out of the box.

Kind regards,

Peter Kriens

> On 2 Mar 2017, at 09:42, Mestiri Meher  wrote:
> 
> Hello guys,
> 
> I have another rookie question about osgi.
> 
> I'm creating an osgi project with multiple bundles. 
> 
> I want to put all the same and shared dependencies of these bundles in a 
> service registry or anywhere in Felix context so all bundles can use these 
> shared libraries.
> 
> What I understood is I have to having them as bundles too, so I found the 
> maven plugin that helps in wrapping those depepndencies into bundles.
> 
> Correct me if I'm wrong but I think the steps are the following :
> 
> 1/ wrap the dependencies into wrappes.
> 2/ install them as bundles into the felix.
> 3/ make those bundles start oncethe felix starts.
> 
> 
> Following this I'm having an issue with an sl4j logger dependency : 
> "slf4j.simple_1.6.1.jar"
> and the error is that I can not start the bundle..
> 
> "org.osgi.framework.BundleException: Fragment bundles can not be started."
> 
> Could you please let me know if I'm following the right scenario and if you 
> have an idea on how I could resolve the slf4j dependency.
> 
> Kind Regards,
> Meher
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev