Skip to content

Commit

Permalink
fixes #1 - changes class loader during initialization of Velocity
Browse files Browse the repository at this point in the history
  • Loading branch information
tjuerge committed Jan 1, 2016
1 parent c0b17b4 commit 9cde377
Showing 1 changed file with 9 additions and 2 deletions.
Expand Up @@ -62,8 +62,15 @@ public synchronized void init() {
setProperty(RUNTIME_LOG_LOGSYSTEM_CLASS,
NullLogChute.class.getCanonicalName());

// Call super implementation
super.init();
// Call super implementation - Massage TCCL to deal with bug in m2e
// (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=396554)
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(RuntimeInstance.class.getClassLoader());
try {
super.init();
} finally {
Thread.currentThread().setContextClassLoader(oldClassLoader);
}

// Initialize user directives
initializeUserDirectives();
Expand Down

0 comments on commit 9cde377

Please sign in to comment.