Index: E:/workspace-3.3.1.1/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java =================================================================== --- E:/workspace-3.3.1.1/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java (revision 5434) +++ E:/workspace-3.3.1.1/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java (working copy) @@ -150,6 +150,34 @@ return newInstance; } + protected ClassLoader getContextLoader() { + URL[] customClassPathURLS = prefs.getCustomClassPathURLS(); + return new URLClassLoader( customClassPathURLS, getParentClassLoader() ) { + protected Class findClass(String name) throws ClassNotFoundException { + try { + return super.findClass( name ); + } catch(ClassNotFoundException cnfe) { + throw cnfe; + } + } + + protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException { + try { + return super.loadClass( name, resolve ); + } catch(ClassNotFoundException cnfe) { + throw cnfe; + } + } + + public Class loadClass(String name) throws ClassNotFoundException { + try { + return super.loadClass( name ); + } catch(ClassNotFoundException cnfe) { + throw cnfe; + } + } + }; + } /** * @return * @@ -155,32 +183,8 @@ * */ public Configuration buildWith(final Configuration cfg, final boolean includeMappings) { - URL[] customClassPathURLS = prefs.getCustomClassPathURLS(); - executionContext = new DefaultExecutionContext( getName(), new URLClassLoader( customClassPathURLS, getParentClassLoader() ) { - protected Class findClass(String name) throws ClassNotFoundException { - try { - return super.findClass( name ); - } catch(ClassNotFoundException cnfe) { - throw cnfe; - } - } - - protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException { - try { - return super.loadClass( name, resolve ); - } catch(ClassNotFoundException cnfe) { - throw cnfe; - } - } - - public Class loadClass(String name) throws ClassNotFoundException { - try { - return super.loadClass( name ); - } catch(ClassNotFoundException cnfe) { - throw cnfe; - } - } - }); + //URL[] customClassPathURLS = prefs.getCustomClassPathURLS(); + executionContext = new DefaultExecutionContext( getName(), getContextLoader() ); Configuration result = (Configuration) executionContext.execute(new ExecutionContext.Command() { Index: E:/workspace-3.3.1.1/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/DefaultExecutionContext.java =================================================================== --- E:/workspace-3.3.1.1/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/DefaultExecutionContext.java (revision 5434) +++ E:/workspace-3.3.1.1/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/DefaultExecutionContext.java (working copy) @@ -32,7 +32,7 @@ public class DefaultExecutionContext implements ExecutionContext { - final private URLClassLoader configurationClassLoader; + final private ClassLoader configurationClassLoader; private volatile int installs; private Map previousLoaders = new WeakHashMap(); @@ -38,7 +38,7 @@ final String key; - public DefaultExecutionContext(String key, URLClassLoader loader) { + public DefaultExecutionContext(String key, ClassLoader loader) { configurationClassLoader = loader; this.key = key; }