ClassLoader old = Thread.currentThread().getContextClassLoader();
ClassLoader loader = this.getClass().getClassLoader();
Thread.currentThread().setContextClassLoader(loader);
String sysPath = System.getProperty("java.class.path");
try {
WsimportTool compTool = new WsimportTool(logstr);
if(xmlCatalog != null){
compTool.setEntityResolver(xmlCatalog);
}
if (loader instanceof AntClassLoader) {
System.setProperty("java.class.path", ((AntClassLoader)loader).getClasspath());
}
ok = compTool.run(cmd.getJavaCommand().getArguments());
} finally {
if (sysPath != null) {
System.setProperty("java.class.path", sysPath);
}
Thread.currentThread().setContextClassLoader(old);