On 21/01/2013 20:30, Konstantin Kolinko wrote:
> 2013/1/21 Peter Lavin <lav...@cs.tcd.ie>:
>>
>> Dear List,
>>
>> My web application needs to deserialize both classes and objects which are
>> sent to it.
>>
>> I'm using Base64 serialization, and when I transport full <name>.class file
>> to a service, I can deserialize it with no problem using
>> ObjectInputStream.readObject(). I also need to transport instances of
>> certain classes to the application but without having the benefit of having
>> the class loaded in the WebappClassLoader. Not surprisingly, deserializing
>> an instance of a class fails for ClassNotFoundException.
>>
>> My question: When I need to transport an instance of a class, I can easily
>> also transport the full class. This full class can be instantiated if
>> required. How could I load this class to the WebappClassLoader and have it
>> available there for when I need to call ois.readObject()? I want to load the
>> (full) class to the WebClassLoader to over come the ClassNotFoundException.
>>
> 
> The same as with any other ClassLoader:
> use the bytes and call ClassLoader.defineClass(..), then
> ClassLoader.resolveClass(..).

No can do.

That method is not public.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to