You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Cristiano Costantini <cr...@gmail.com> on 2016/06/21 17:20:25 UTC

[Cellar] How can I use the org.apache.karaf.cellar.core.utils.CombinedClassLoader ?

Hello all,

I'm struggling to fix an issue where I am sending a message to topic over
the Hazelcast instance of Cellar.

I get a ClassNotFoundException from within the CombinedClassLoader when
deserializing the topic.

From the Javadoc of the class I see that "A bundle can add itself for to
this class loader, so that the class loader can load classes from the
bundle. It is meant to be used together with the extender pattern in order
to extends Cellar class space."

But I have no idea how to put in practice this extender pattern...
could you help me?

thank you in advance!

Cristiano


P.S. This the exception full stack trace:

Caused by: java.lang.ClassNotFoundException:
net.cristcost.model.Availability
at
org.apache.karaf.cellar.core.utils.CombinedClassLoader.findClass(CombinedClassLoader.java:60)[270:org.apache.karaf.cellar.core:4.0.0]

at java.lang.ClassLoader.loadClass(ClassLoader.java:424)[:1.8.0_60]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_60]
at com.hazelcast.nio.ClassLoaderUtil.tryLoadClass(ClassLoaderUtil.java:125)
at com.hazelcast.nio.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:114)
at com.hazelcast.nio.IOUtil$1.resolveClass(IOUtil.java:113)
at
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1613)[:1.8.0_60]

Re: [Cellar] How can I use the org.apache.karaf.cellar.core.utils.CombinedClassLoader ?

Posted by Cristiano Costantini <cr...@gmail.com>.
Hello JB,
thank you for the hint,
in fact yes sometime I've used the TCCL like for example it is explained in
this page
http://stackoverflow.com/questions/2198928/better-handling-of-thread-context-classloader-in-osgi
 (I was just not calling this way)

for the moment I've found a workaround and as I'm busy so I'll stick with
it, but I really would like to better understand what can be done to
improve the solution.
I'll try to join the IRC channel some day !

Thank you,
Cristiano



Il giorno mar 21 giu 2016 alle ore 21:15 Jean-Baptiste Onofré <
jb@nanthrax.net> ha scritto:

> TCCL is the ThreadContextClassLoader.
>
> If you explain on IRC what you try to achieve, I can guide you to fix that.
>
> Regards
> JB
>
> On 06/21/2016 09:05 PM, Cristiano Costantini wrote:
> > No, never heard about it, what is it and where can I found info?
> >
> > Thank you very much!
> >
> > Cristiano
> > Il giorno Tue, 21 Jun 2016 alle 21:00 Jean-Baptiste Onofré
> > <jb@nanthrax.net <ma...@nanthrax.net>> ha scritto:
> >
> >     Hi Cristiano,
> >
> >     Do you use TCCL ?
> >
> >     Regards
> >     JB
> >
> >     On 06/21/2016 07:20 PM, Cristiano Costantini wrote:
> >      > Hello all,
> >      >
> >      > I'm struggling to fix an issue where I am sending a message to
> topic
> >      > over the Hazelcast instance of Cellar.
> >      >
> >      > I get a ClassNotFoundException from within the
> >     CombinedClassLoader when
> >      > deserializing the topic.
> >      >
> >      >  From the Javadoc of the class I see that "A bundle can add
> >     itself for
> >      > to this class loader, so that the class loader can load classes
> >     from the
> >      > bundle. It is meant to be used together with the extender pattern
> in
> >      > order to extends Cellar class space."
> >      >
> >      > But I have no idea how to put in practice this extender pattern...
> >      > could you help me?
> >      >
> >      > thank you in advance!
> >      >
> >      > Cristiano
> >      >
> >      >
> >      > P.S. This the exception full stack trace:
> >      >
> >      > Caused by: java.lang.ClassNotFoundException:
> >      > net.cristcost.model.Availability
> >      > at
> >      >
> >
>  org.apache.karaf.cellar.core.utils.CombinedClassLoader.findClass(CombinedClassLoader.java:60)[270:org.apache.karaf.cellar.core:4.0.0]
> >      >
> >      > at
> java.lang.ClassLoader.loadClass(ClassLoader.java:424)[:1.8.0_60]
> >      > at
> java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_60]
> >      > at
> >
>  com.hazelcast.nio.ClassLoaderUtil.tryLoadClass(ClassLoaderUtil.java:125)
> >      > at
> >     com.hazelcast.nio.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:114)
> >      > at com.hazelcast.nio.IOUtil$1.resolveClass(IOUtil.java:113)
> >      > at
> >      >
> >
>  java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1613)[:1.8.0_60]
> >      >
> >      >
> >      >
> >
> >     --
> >     Jean-Baptiste Onofré
> >     jbonofre@apache.org <ma...@apache.org>
> >     http://blog.nanthrax.net
> >     Talend - http://www.talend.com
> >
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Re: [Cellar] How can I use the org.apache.karaf.cellar.core.utils.CombinedClassLoader ?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
TCCL is the ThreadContextClassLoader.

If you explain on IRC what you try to achieve, I can guide you to fix that.

Regards
JB

On 06/21/2016 09:05 PM, Cristiano Costantini wrote:
> No, never heard about it, what is it and where can I found info?
>
> Thank you very much!
>
> Cristiano
> Il giorno Tue, 21 Jun 2016 alle 21:00 Jean-Baptiste Onofr�
> <jb@nanthrax.net <ma...@nanthrax.net>> ha scritto:
>
>     Hi Cristiano,
>
>     Do you use TCCL ?
>
>     Regards
>     JB
>
>     On 06/21/2016 07:20 PM, Cristiano Costantini wrote:
>      > Hello all,
>      >
>      > I'm struggling to fix an issue where I am sending a message to topic
>      > over the Hazelcast instance of Cellar.
>      >
>      > I get a ClassNotFoundException from within the
>     CombinedClassLoader when
>      > deserializing the topic.
>      >
>      >  From the Javadoc of the class I see that "A bundle can add
>     itself for
>      > to this class loader, so that the class loader can load classes
>     from the
>      > bundle. It is meant to be used together with the extender pattern in
>      > order to extends Cellar class space."
>      >
>      > But I have no idea how to put in practice this extender pattern...
>      > could you help me?
>      >
>      > thank you in advance!
>      >
>      > Cristiano
>      >
>      >
>      > P.S. This the exception full stack trace:
>      >
>      > Caused by: java.lang.ClassNotFoundException:
>      > net.cristcost.model.Availability
>      > at
>      >
>     org.apache.karaf.cellar.core.utils.CombinedClassLoader.findClass(CombinedClassLoader.java:60)[270:org.apache.karaf.cellar.core:4.0.0]
>      >
>      > at java.lang.ClassLoader.loadClass(ClassLoader.java:424)[:1.8.0_60]
>      > at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_60]
>      > at
>     com.hazelcast.nio.ClassLoaderUtil.tryLoadClass(ClassLoaderUtil.java:125)
>      > at
>     com.hazelcast.nio.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:114)
>      > at com.hazelcast.nio.IOUtil$1.resolveClass(IOUtil.java:113)
>      > at
>      >
>     java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1613)[:1.8.0_60]
>      >
>      >
>      >
>
>     --
>     Jean-Baptiste Onofr�
>     jbonofre@apache.org <ma...@apache.org>
>     http://blog.nanthrax.net
>     Talend - http://www.talend.com
>

-- 
Jean-Baptiste Onofr�
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: [Cellar] How can I use the org.apache.karaf.cellar.core.utils.CombinedClassLoader ?

Posted by Cristiano Costantini <cr...@gmail.com>.
No, never heard about it, what is it and where can I found info?

Thank you very much!

Cristiano
Il giorno Tue, 21 Jun 2016 alle 21:00 Jean-Baptiste Onofré <jb...@nanthrax.net>
ha scritto:

> Hi Cristiano,
>
> Do you use TCCL ?
>
> Regards
> JB
>
> On 06/21/2016 07:20 PM, Cristiano Costantini wrote:
> > Hello all,
> >
> > I'm struggling to fix an issue where I am sending a message to topic
> > over the Hazelcast instance of Cellar.
> >
> > I get a ClassNotFoundException from within the CombinedClassLoader when
> > deserializing the topic.
> >
> >  From the Javadoc of the class I see that "A bundle can add itself for
> > to this class loader, so that the class loader can load classes from the
> > bundle. It is meant to be used together with the extender pattern in
> > order to extends Cellar class space."
> >
> > But I have no idea how to put in practice this extender pattern...
> > could you help me?
> >
> > thank you in advance!
> >
> > Cristiano
> >
> >
> > P.S. This the exception full stack trace:
> >
> > Caused by: java.lang.ClassNotFoundException:
> > net.cristcost.model.Availability
> > at
> >
> org.apache.karaf.cellar.core.utils.CombinedClassLoader.findClass(CombinedClassLoader.java:60)[270:org.apache.karaf.cellar.core:4.0.0]
> >
> > at java.lang.ClassLoader.loadClass(ClassLoader.java:424)[:1.8.0_60]
> > at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_60]
> > at
> com.hazelcast.nio.ClassLoaderUtil.tryLoadClass(ClassLoaderUtil.java:125)
> > at com.hazelcast.nio.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:114)
> > at com.hazelcast.nio.IOUtil$1.resolveClass(IOUtil.java:113)
> > at
> >
> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1613)[:1.8.0_60]
> >
> >
> >
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Re: [Cellar] How can I use the org.apache.karaf.cellar.core.utils.CombinedClassLoader ?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Cristiano,

Do you use TCCL ?

Regards
JB

On 06/21/2016 07:20 PM, Cristiano Costantini wrote:
> Hello all,
>
> I'm struggling to fix an issue where I am sending a message to topic
> over the Hazelcast instance of Cellar.
>
> I get a ClassNotFoundException from within the CombinedClassLoader when
> deserializing the topic.
>
>  From the Javadoc of the class I see that "A bundle can add itself for
> to this class loader, so that the class loader can load classes from the
> bundle. It is meant to be used together with the extender pattern in
> order to extends Cellar class space."
>
> But I have no idea how to put in practice this extender pattern...
> could you help me?
>
> thank you in advance!
>
> Cristiano
>
>
> P.S. This the exception full stack trace:
>
> Caused by: java.lang.ClassNotFoundException:
> net.cristcost.model.Availability
> at
> org.apache.karaf.cellar.core.utils.CombinedClassLoader.findClass(CombinedClassLoader.java:60)[270:org.apache.karaf.cellar.core:4.0.0]
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:424)[:1.8.0_60]
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_60]
> at com.hazelcast.nio.ClassLoaderUtil.tryLoadClass(ClassLoaderUtil.java:125)
> at com.hazelcast.nio.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:114)
> at com.hazelcast.nio.IOUtil$1.resolveClass(IOUtil.java:113)
> at
> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1613)[:1.8.0_60]
>
>
>

-- 
Jean-Baptiste Onofr�
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com