Hi again Chris, comments below

On 01/24/2013 07:05 PM, Christopher Schultz wrote:
What if you try this:

ClassLoader contextClassLoader =
Thread.currentThread().getContextClassLoader();

FileClassLoader cl = new FileClassLoader(contextClassLoader);

Class<?>  spClass = cl.arrayToClass(null, byArray, True);

Thread.currentThread().setContextClassLoader(cl);

Tomcat changes the context ClassLoader all the time, and you'll want
your ClassLoaders to remember previously-loaded classes, so this isn't
a great solution in general.

That's why I suggested that you use a "loader" configured in
context.xml: that will let you define your own ClassLoader where you
can call arrayToClass at any point and not have to set the context
ClassLoader all the time.

If you've got something working and you're happy, then there's nothing
left to do. If it were me, I'd use a custom Loader for my webapp and
use Java's ObjectInputStream.

This failed in much the same way as before. Like you say :-) what I have is working and will suffice for the time being, thanks for your help. I will look in to using context.xml later maybe.

regards
Peter





--
with best regards,
Peter Lavin,
PhD Candidate,
CAG - Computer Architecture & Grid Research Group,
Lloyd Institute, 005,
Trinity College Dublin, Ireland.
+353 1 8961536

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

Reply via email to