Index: /trunk/autoquest-plugin-core/src/main/java/de/ugoe/cs/autoquest/plugin/PluginLoader.java
===================================================================
--- /trunk/autoquest-plugin-core/src/main/java/de/ugoe/cs/autoquest/plugin/PluginLoader.java	(revision 2277)
+++ /trunk/autoquest-plugin-core/src/main/java/de/ugoe/cs/autoquest/plugin/PluginLoader.java	(revision 2278)
@@ -16,5 +16,8 @@
 
 import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
 import java.io.FilenameFilter;
+import java.io.IOException;
 import java.lang.reflect.InvocationTargetException;
 import java.net.MalformedURLException;
@@ -25,4 +28,6 @@
 import java.util.LinkedList;
 import java.util.List;
+import java.util.jar.JarInputStream;
+import java.util.jar.Manifest;
 
 /**
@@ -96,5 +101,5 @@
         if (jarFiles != null) {
             for (File jarFile : jarFiles) {
-                updateClassLoader(jarFile);
+                ClassLoader loader = getClassLoader(jarFile);
 
                 String pluginName = jarFile.getName().split("-")[2];
@@ -104,5 +109,5 @@
                 Class<?> pluginClass = null;
                 try {
-                    pluginClass = Class.forName(pluginClassName);
+                    pluginClass = loader.loadClass(pluginClassName);
                 }
                 catch (ClassNotFoundException e) {
@@ -150,23 +155,48 @@
      * </p>
      */
-    /*
-     * protected String[] getClassPathFromJar(File jarFile) { String[] classPath;
-     * 
-     * JarInputStream jarInputStream = null; Manifest manifest = null; try { FileInputStream
-     * fileStream = new FileInputStream(jarFile); try { jarInputStream = new
-     * JarInputStream(fileStream); manifest = jarInputStream.getManifest(); } finally {
-     * jarInputStream.close(); fileStream.close(); } } catch (FileNotFoundException e) { throw new
-     * AssertionError( "FileNotFoundException should be impossible!"); } catch (IOException e) {
-     * throw new PluginLoaderException(e); }
-     * 
-     * String jarClassPath = manifest.getMainAttributes().getValue( "Class-Path");
-     * 
-     * if (jarClassPath != null) { String[] jarClassPathElements = jarClassPath.split(" ");
-     * classPath = new String[jarClassPathElements.length]; for (int i = 0; i <
-     * jarClassPathElements.length; i++) { classPath[i] = "file:" +
-     * jarFile.getParentFile().getAbsolutePath() + "/" + jarClassPathElements[i]; } try {
-     * jarInputStream.close(); } catch (IOException e) { throw new PluginLoaderException(e); } }
-     * else { classPath = new String[] {}; } return classPath; }
-     */
+    
+     protected String[] getClassPathFromJar(File jarFile) {
+        String[] classPath;
+        JarInputStream jarInputStream = null;
+        Manifest manifest = null;
+        try {
+            FileInputStream fileStream = new FileInputStream(jarFile);
+            try {
+                jarInputStream = new JarInputStream(fileStream);
+                manifest = jarInputStream.getManifest();
+            }
+            finally {
+                jarInputStream.close();
+                fileStream.close();
+            }
+        }
+        catch (FileNotFoundException e) {
+            throw new AssertionError("FileNotFoundException should be impossible!");
+        }
+        catch (IOException e) {
+            throw new PluginLoaderException(e);
+        }
+
+        String jarClassPath = manifest.getMainAttributes().getValue("Class-Path");
+
+        if (jarClassPath != null) {
+            String[] jarClassPathElements = jarClassPath.split(" ");
+            classPath = new String[jarClassPathElements.length];
+            for (int i = 0; i < jarClassPathElements.length; i++) {
+                classPath[i] = "file:" + jarFile.getParentFile().getAbsolutePath() + "/" +
+                    jarClassPathElements[i];
+            }
+            try {
+                jarInputStream.close();
+            }
+            catch (IOException e) {
+                throw new PluginLoaderException(e);
+            }
+        }
+        else {
+            classPath = new String[] { };
+        }
+        return classPath;
+    }     
 
     /**
@@ -182,13 +212,23 @@
      *             thrown if there is a problem updating the class loader or loading the plug-in jar
      */
-    private void updateClassLoader(File jarFile) throws PluginLoaderException {
-        // String[] classPath = getClassPathFromJar(jarFile);
+    private ClassLoader getClassLoader(File jarFile) throws PluginLoaderException {
+        String[] otherJars = getClassPathFromJar(jarFile);
 
         try {
+            URL[] urls = new URL[otherJars.length + 1];
+            urls[0] = new URL("jar:file:" + jarFile.getAbsoluteFile() + "!/");
+            
+            int index = 1;
+            for (String jar : otherJars) {
+                urls[index++] = new URL("jar:file:" + new File(jar).getAbsoluteFile() + "!/");
+            }
+            
             URLClassLoader loader = new URLClassLoader(new URL[]
-                { new URL("file:" + jarFile.getAbsoluteFile()) },
+                { new URL("jar:file:" + jarFile.getAbsoluteFile() + "!/") },
                                                     ClassLoader.getSystemClassLoader());
             
             instantiatedClassLoaders.add(loader);
+            
+            return loader;
         }
         catch (MalformedURLException e) {
