You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Tillmann Wegst <t....@oxseed.com> on 2011/09/21 18:15:25 UTC

Re: getObject ClassNotFound exception

Denis Baudin <db...@...> writes:

> Hello,
> 
> I'm running ActiveMQ 1.5 on BEA Weblogic 8.1 and I ran into a
> classloader issue 
> (...)
> The solution was to create an anonymous class which extended
> ObjectInputStream (call it from getObject) inside ActiveMQObjectMessage
> and get the contextclassloader
> 
>     class ObjectInputStreamExt extends ObjectInputStream
>     {
>       ObjectInputStreamExt(InputStream is) throws IOException	
>       {		
>         super(is);  
>       }
>       protected Class resolveClass(ObjectStreamClass v) throws
> IOException, ClassNotFoundException
>       {
>         ClassLoader cl = Thread.currentThread().getContextClassLoader();
>         String name = v.getName();
>         return cl.loadClass(name);
>       }
>     }

Hello Denis, 

your solution sounds promising, but from what you wrote I fail to get 
how to implement this. 

Would you have the time to post the snippet of code that does what 
you've described? 

(I'm currently having the problem in an application running on 
Geronimo.) 

Regards, Tillmann