URLClassLoader newClassLoader = new URLClassLoader( (URL[]) jarUrls.toArray( new URL[jarUrls.size()] ), cp );
Thread.currentThread().setContextClassLoader( newClassLoader );
classPathApplicationContext.setClassLoader( newClassLoader );
PlexusFileSystemXmlApplicationContext fileSystemApplicationContext = new PlexusFileSystemXmlApplicationContext(
(String[]) jars.toArray( new String[jars.size()] ), classPathApplicationContext );
fileSystemApplicationContext.setClassLoader( newClassLoader );
container.setApplicationContext( fileSystemApplicationContext );
DatabaseFactoryConfigurator configurator = (DatabaseFactoryConfigurator) container.lookup(
DatabaseFactoryConfigurator.class.getName(), configRoleHint );
configurator.configure( params );