private final ClassLoader parentClassLoader = new ClassLoader(null) {
private final ClassLoader delegateTo = Thread.currentThread().getContextClassLoader();
@Override
protected Class<?> findClass(String name) throws ClassNotFoundException {
if (webAppClassLoader != null
&& (webAppClassLoader.isServerPath(name) || webAppClassLoader.isSystemPath(name))) {
return delegateTo.loadClass(name);
}
throw new ClassNotFoundException();
}
};
Another question about configuring jetty : it expects a web.xml to define the RPC servlets. Many of us will use some more complex server side setup, for example including Spring and Hibernate, DataSources configuration, ... etcRunning such "complex" server side components with hosted mode is easy with noserver, as we can setup the adequate servlet container. But with hosted mode jetty I fall into classloaders issues (jetty expect my libs to be in WEB-INF/lib, but they are set in eclipse launch classpath)
The issue here with maven integration is that even the simpliest server setup (only RPC RemoteServlet with no dependency on any other lib) requires to put project classes and gwt-* libs in jetty WEB-INF, that is not the best option for maven as it requires many files to get copied.