The typical pattern for a custom classloader would also use:

    Thread thread = Thread.currentThread();
    ClassLoader oldLoader = thread.getContextClassLoader();
    try {

    } finally {

That way, any dependent classes would get picked up properly even if
using reflection.
You're right, thanks - I'll adjust my code :)

Well, for 4.0.18, one of the bugs/features we need to put in is a way to
customize the persistence (primarily for jdbc-style sessions, but I
believe some others want to customize the capability.)

So I can keep this use-case in mind when I put together that API.
Nice, thanks :)
But it might be cleaner to use the ContextClassLoader pattern with a
session-config so you don't actually need to write a custom serializer.
This will actually not work properly, since ObjectInputStream.readObject does not honor the thread's contextclassloader when resolving classes, see, dating back to 2000. (Resolved as Closed, Will Not Fix)

-- Edvin
resin-interest mailing list

Reply via email to