Skip to content
Snippets Groups Projects
Commit 562bb36b authored by Simon Rettberg's avatar Simon Rettberg
Browse files

Rework plugin loading a little

parent 49827801
No related branches found
No related tags found
No related merge requests found
...@@ -20,7 +20,9 @@ public class App ...@@ -20,7 +20,9 @@ public class App
public static void main( String[] args ) throws SocketException public static void main( String[] args ) throws SocketException
{ {
BasicConfigurator.configure();
// Load all task plugins // Load all task plugins
Thread.currentThread().setContextClassLoader( ClassLoader.getSystemClassLoader() );
File folder = new File( "./plugins" ); File folder = new File( "./plugins" );
if ( !folder.exists() ) { if ( !folder.exists() ) {
System.out.println( "No plugin folder found - nothing to do." ); System.out.println( "No plugin folder found - nothing to do." );
...@@ -37,7 +39,6 @@ public class App ...@@ -37,7 +39,6 @@ public class App
System.exit( 1 ); System.exit( 1 );
} }
} }
BasicConfigurator.configure();
Environment.load( "config/environment" ); Environment.load( "config/environment" );
NetworkHandler.init(); NetworkHandler.init();
Taskmanager.run(); Taskmanager.run();
......
...@@ -53,7 +53,7 @@ public class ClassLoaderHack ...@@ -53,7 +53,7 @@ public class ClassLoaderHack
{ {
final Class<?> clazz; final Class<?> clazz;
try { try {
clazz = Class.forName( packageName + '.' + className, true, ClassLoader.getSystemClassLoader() ); clazz = Class.forName( packageName + '.' + className );
} catch ( ClassNotFoundException e ) { } catch ( ClassNotFoundException e ) {
return null; return null;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment