try {
PluginClassLoader pcl = new PluginClassLoader(pluginDir, new Class[] {WikiPlugin.class});
List<Class<?>> plugins = pcl.getClasses(WikiPlugin.class);
if (plugins != null) {
for (Class<?> clazz: plugins) {
WikiPlugin plugin;
try {
plugin = ((Class<WikiPlugin>) clazz).newInstance();
plugin.init(this);
} catch (Exception e) {
System.err.println("failed to load plugin " + clazz.getCanonicalName());
e.printStackTrace();
continue;
}