You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@aries.apache.org by "Lim, See Peng" <se...@experian.com> on 2016/07/12 10:53:51 UTC

Class loading issue in apache aries blueprint context

Hi all,

We noticed that when a bean is initialized in apache aries blueprint context, it will use the LauncherAppClassLoader instead of bundle class loader , hence it can't access resources such as classes or file in a bundle.

I am trying to check the apache aries trunk source code and found out there is a deprecated class "org.apache.aries.blueprint.utils.BundleDelegatingClassLoader". Is this class used to delegating system class loader to bundle class loader?  How can we make a bean will always initialized using the bundle classloader in blueprint context?

Really appreciate your help on this issue.

Thanks.

Regards,
See Peng


Re: Class loading issue in apache aries blueprint context

Posted by Grzegorz Grzybek <gr...@gmail.com>.
Hello

Hmm. Maybe you added your JAR to initial classpath? Like KARAF_HOME/lib
directory? How did you install your bundle with blueprint descriptor?

regards
Grzegorz

2016-07-14 2:42 GMT+02:00 Lim, See Peng <se...@experian.com>:

> Hi Grzegorz,
>
>
>
> I am running inside full OSGI runtime, is that mean it won’t use
> BundleClassLoaders?
>
>
>
> Regards,
>
> See Peng
>
>
>
> *From:* Grzegorz Grzybek [mailto:gr.grzybek@gmail.com]
> *Sent:* Tuesday, July 12, 2016 7:35 PM
> *To:* user@aries.apache.org
> *Subject:* Re: Class loading issue in apache aries blueprint context
>
>
>
> Hello
>
> Are you running your blueprint inside full OSGi runtime or via
> camel-test-blueprint? In latter case you're using felix-connect (previously
> known as PojoSR), which doesn't use full BundleClassLoaders.
>
> regards
>
> Grzegorz
>
>
>
> 2016-07-12 12:53 GMT+02:00 Lim, See Peng <se...@experian.com>:
>
> Hi all,
>
>
>
> We noticed that when a bean is initialized in apache aries blueprint
> context, it will use the LauncherAppClassLoader instead of bundle class
> loader , hence it can’t access resources such as classes or file in a
> bundle.
>
>
>
> I am trying to check the apache aries trunk source code and found out
> there is a deprecated class
> “org.apache.aries.blueprint.utils.BundleDelegatingClassLoader”. Is this
> class used to delegating system class loader to bundle class loader?  How
> can we make a bean will always initialized using the bundle classloader in
> blueprint context?
>
>
>
> Really appreciate your help on this issue.
>
>
>
> Thanks.
>
>
>
> Regards,
>
> See Peng
>
>
>
>
>

Re: Class loading issue in apache aries blueprint context

Posted by Grzegorz Grzybek <gr...@gmail.com>.
@Matt - you should find an unsubscribe linke somewhere ;)

Believe me - there are people still using RPC/Encoded style web services.
Or Corba.

~Grzegorz

2016-07-14 7:36 GMT+02:00 Matt Madhavan <ma...@gmail.com>:

> Not sure why am I still getting mails from this post!
>
> Great idea, but OSGi, is dead:(
>
> Any ideas?
>
> On Jul 13, 2016 7:43 PM, "Lim, See Peng" <se...@experian.com> wrote:
>
>> Hi Grzegorz,
>>
>>
>>
>> I am running inside full OSGI runtime, is that mean it won’t use
>> BundleClassLoaders?
>>
>>
>>
>> Regards,
>>
>> See Peng
>>
>>
>>
>> *From:* Grzegorz Grzybek [mailto:gr.grzybek@gmail.com]
>> *Sent:* Tuesday, July 12, 2016 7:35 PM
>> *To:* user@aries.apache.org
>> *Subject:* Re: Class loading issue in apache aries blueprint context
>>
>>
>>
>> Hello
>>
>> Are you running your blueprint inside full OSGi runtime or via
>> camel-test-blueprint? In latter case you're using felix-connect (previously
>> known as PojoSR), which doesn't use full BundleClassLoaders.
>>
>> regards
>>
>> Grzegorz
>>
>>
>>
>> 2016-07-12 12:53 GMT+02:00 Lim, See Peng <se...@experian.com>:
>>
>> Hi all,
>>
>>
>>
>> We noticed that when a bean is initialized in apache aries blueprint
>> context, it will use the LauncherAppClassLoader instead of bundle class
>> loader , hence it can’t access resources such as classes or file in a
>> bundle.
>>
>>
>>
>> I am trying to check the apache aries trunk source code and found out
>> there is a deprecated class
>> “org.apache.aries.blueprint.utils.BundleDelegatingClassLoader”. Is this
>> class used to delegating system class loader to bundle class loader?  How
>> can we make a bean will always initialized using the bundle classloader in
>> blueprint context?
>>
>>
>>
>> Really appreciate your help on this issue.
>>
>>
>>
>> Thanks.
>>
>>
>>
>> Regards,
>>
>> See Peng
>>
>>
>>
>>
>>
>

RE: Class loading issue in apache aries blueprint context

Posted by Matt Madhavan <ma...@gmail.com>.
Not sure why am I still getting mails from this post!

Great idea, but OSGi, is dead:(

Any ideas?

On Jul 13, 2016 7:43 PM, "Lim, See Peng" <se...@experian.com> wrote:

> Hi Grzegorz,
>
>
>
> I am running inside full OSGI runtime, is that mean it won’t use
> BundleClassLoaders?
>
>
>
> Regards,
>
> See Peng
>
>
>
> *From:* Grzegorz Grzybek [mailto:gr.grzybek@gmail.com]
> *Sent:* Tuesday, July 12, 2016 7:35 PM
> *To:* user@aries.apache.org
> *Subject:* Re: Class loading issue in apache aries blueprint context
>
>
>
> Hello
>
> Are you running your blueprint inside full OSGi runtime or via
> camel-test-blueprint? In latter case you're using felix-connect (previously
> known as PojoSR), which doesn't use full BundleClassLoaders.
>
> regards
>
> Grzegorz
>
>
>
> 2016-07-12 12:53 GMT+02:00 Lim, See Peng <se...@experian.com>:
>
> Hi all,
>
>
>
> We noticed that when a bean is initialized in apache aries blueprint
> context, it will use the LauncherAppClassLoader instead of bundle class
> loader , hence it can’t access resources such as classes or file in a
> bundle.
>
>
>
> I am trying to check the apache aries trunk source code and found out
> there is a deprecated class
> “org.apache.aries.blueprint.utils.BundleDelegatingClassLoader”. Is this
> class used to delegating system class loader to bundle class loader?  How
> can we make a bean will always initialized using the bundle classloader in
> blueprint context?
>
>
>
> Really appreciate your help on this issue.
>
>
>
> Thanks.
>
>
>
> Regards,
>
> See Peng
>
>
>
>
>

RE: Class loading issue in apache aries blueprint context

Posted by "Lim, See Peng" <se...@experian.com>.
Hi Grzegorz,

I am running inside full OSGI runtime, is that mean it won’t use BundleClassLoaders?

Regards,
See Peng

From: Grzegorz Grzybek [mailto:gr.grzybek@gmail.com]
Sent: Tuesday, July 12, 2016 7:35 PM
To: user@aries.apache.org
Subject: Re: Class loading issue in apache aries blueprint context

Hello
Are you running your blueprint inside full OSGi runtime or via camel-test-blueprint? In latter case you're using felix-connect (previously known as PojoSR), which doesn't use full BundleClassLoaders.
regards
Grzegorz

2016-07-12 12:53 GMT+02:00 Lim, See Peng <se...@experian.com>>:
Hi all,

We noticed that when a bean is initialized in apache aries blueprint context, it will use the LauncherAppClassLoader instead of bundle class loader , hence it can’t access resources such as classes or file in a bundle.

I am trying to check the apache aries trunk source code and found out there is a deprecated class “org.apache.aries.blueprint.utils.BundleDelegatingClassLoader”. Is this class used to delegating system class loader to bundle class loader?  How can we make a bean will always initialized using the bundle classloader in blueprint context?

Really appreciate your help on this issue.

Thanks.

Regards,
See Peng



Re: Class loading issue in apache aries blueprint context

Posted by Grzegorz Grzybek <gr...@gmail.com>.
Hello

Are you running your blueprint inside full OSGi runtime or via
camel-test-blueprint? In latter case you're using felix-connect (previously
known as PojoSR), which doesn't use full BundleClassLoaders.

regards
Grzegorz

2016-07-12 12:53 GMT+02:00 Lim, See Peng <se...@experian.com>:

> Hi all,
>
>
>
> We noticed that when a bean is initialized in apache aries blueprint
> context, it will use the LauncherAppClassLoader instead of bundle class
> loader , hence it can’t access resources such as classes or file in a
> bundle.
>
>
>
> I am trying to check the apache aries trunk source code and found out
> there is a deprecated class
> “org.apache.aries.blueprint.utils.BundleDelegatingClassLoader”. Is this
> class used to delegating system class loader to bundle class loader?  How
> can we make a bean will always initialized using the bundle classloader in
> blueprint context?
>
>
>
> Really appreciate your help on this issue.
>
>
>
> Thanks.
>
>
>
> Regards,
>
> See Peng
>
>
>

Re: Class loading issue in apache aries blueprint context

Posted by Grzegorz Grzybek <gr...@gmail.com>.
if dev-unsubscribe@aries.apache.org / user-unsubscribe@aries.apache.org
doesn't work you should just mark as spam this address.

~Grzegorz

2016-07-14 10:10 GMT+02:00 Matt Madhavan <ma...@gmail.com>:

> How the fuck I get out of this email crap? Believe me I worked hard for
> OSGI more than all you craps convinced!
>
> On Jul 14, 2016 1:52 AM, "Guillaume Nodet" <gn...@apache.org> wrote:
>
>> Blueprint does not set the thread context class loader.
>> You can use the class loader of a class to load resources instead, or
>> manually set the thread context class loader to that of the class being
>> loaded.
>>
>> 2016-07-12 12:53 GMT+02:00 Lim, See Peng <se...@experian.com>:
>>
>>> Hi all,
>>>
>>>
>>>
>>> We noticed that when a bean is initialized in apache aries blueprint
>>> context, it will use the LauncherAppClassLoader instead of bundle class
>>> loader , hence it can’t access resources such as classes or file in a
>>> bundle.
>>>
>>>
>>>
>>> I am trying to check the apache aries trunk source code and found out
>>> there is a deprecated class
>>> “org.apache.aries.blueprint.utils.BundleDelegatingClassLoader”. Is this
>>> class used to delegating system class loader to bundle class loader?  How
>>> can we make a bean will always initialized using the bundle classloader in
>>> blueprint context?
>>>
>>>
>>>
>>> Really appreciate your help on this issue.
>>>
>>>
>>>
>>> Thanks.
>>>
>>>
>>>
>>> Regards,
>>>
>>> See Peng
>>>
>>>
>>>
>>
>>
>>
>> --
>> ------------------------
>> Guillaume Nodet
>> ------------------------
>> Red Hat, Open Source Integration
>>
>> Email: gnodet@redhat.com
>> Web: http://fusesource.com
>> Blog: http://gnodet.blogspot.com/
>>
>>

Re: Class loading issue in apache aries blueprint context

Posted by Matt Madhavan <ma...@gmail.com>.
How the fuck I get out of this email crap? Believe me I worked hard for
OSGI more than all you craps convinced!

On Jul 14, 2016 1:52 AM, "Guillaume Nodet" <gn...@apache.org> wrote:

> Blueprint does not set the thread context class loader.
> You can use the class loader of a class to load resources instead, or
> manually set the thread context class loader to that of the class being
> loaded.
>
> 2016-07-12 12:53 GMT+02:00 Lim, See Peng <se...@experian.com>:
>
>> Hi all,
>>
>>
>>
>> We noticed that when a bean is initialized in apache aries blueprint
>> context, it will use the LauncherAppClassLoader instead of bundle class
>> loader , hence it can’t access resources such as classes or file in a
>> bundle.
>>
>>
>>
>> I am trying to check the apache aries trunk source code and found out
>> there is a deprecated class
>> “org.apache.aries.blueprint.utils.BundleDelegatingClassLoader”. Is this
>> class used to delegating system class loader to bundle class loader?  How
>> can we make a bean will always initialized using the bundle classloader in
>> blueprint context?
>>
>>
>>
>> Really appreciate your help on this issue.
>>
>>
>>
>> Thanks.
>>
>>
>>
>> Regards,
>>
>> See Peng
>>
>>
>>
>
>
>
> --
> ------------------------
> Guillaume Nodet
> ------------------------
> Red Hat, Open Source Integration
>
> Email: gnodet@redhat.com
> Web: http://fusesource.com
> Blog: http://gnodet.blogspot.com/
>
>

Re: Class loading issue in apache aries blueprint context

Posted by Guillaume Nodet <gn...@apache.org>.
Blueprint does not set the thread context class loader.
You can use the class loader of a class to load resources instead, or
manually set the thread context class loader to that of the class being
loaded.

2016-07-12 12:53 GMT+02:00 Lim, See Peng <se...@experian.com>:

> Hi all,
>
>
>
> We noticed that when a bean is initialized in apache aries blueprint
> context, it will use the LauncherAppClassLoader instead of bundle class
> loader , hence it can’t access resources such as classes or file in a
> bundle.
>
>
>
> I am trying to check the apache aries trunk source code and found out
> there is a deprecated class
> “org.apache.aries.blueprint.utils.BundleDelegatingClassLoader”. Is this
> class used to delegating system class loader to bundle class loader?  How
> can we make a bean will always initialized using the bundle classloader in
> blueprint context?
>
>
>
> Really appreciate your help on this issue.
>
>
>
> Thanks.
>
>
>
> Regards,
>
> See Peng
>
>
>



-- 
------------------------
Guillaume Nodet
------------------------
Red Hat, Open Source Integration

Email: gnodet@redhat.com
Web: http://fusesource.com
Blog: http://gnodet.blogspot.com/