diff --git a/src/main/net/sourceforge/jtds/util/TimerThread.java b/src/main/net/sourceforge/jtds/util/TimerThread.java index e7ea933d..472cc99b 100644 --- a/src/main/net/sourceforge/jtds/util/TimerThread.java +++ b/src/main/net/sourceforge/jtds/util/TimerThread.java @@ -97,6 +97,10 @@ public static synchronized TimerThread getInstance() { public TimerThread() { // Set the thread name super("jTDS TimerThread"); + // Set contextClassLoader to library ClassLoader if possible + try { + this.setContextClassLoader(this.getClass().getClassLoader()); + } catch (SecurityException e) { } // Ensure that this thread does not prevent the VM from exiting this.setDaemon(true); }