Print a helpful message when a container's virtual filesystem architecture prevents the reloading classloader to work correctly. Afterwards exception is rethrown

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@772776 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
René Gielen
2009-05-07 21:15:45 +00:00
parent a428f78471
commit ef0eca1083
@@ -35,7 +35,7 @@ import org.apache.struts2.StrutsException;
* The ReloadingClassLoader uses a delegation mechanism to allow
* classes to be reloaded. That means that loadClass calls may
* return different results if the class was changed in the underlying
* ResoruceStore.
* ResourceStore.
* <p/>
* class taken from Apache JCI
*/
@@ -53,6 +53,12 @@ public class ReloadingClassLoader extends ClassLoader {
stores = new ResourceStore[]{new FileResourceStore(new File(root.toURI()))};
} catch (URISyntaxException e) {
throw new StrutsException("Unable to start the reloadable class loader, consider setting 'struts.convention.classes.reload' to false", e);
} catch (RuntimeException e) {
// see WW-3121
// TODO: Fix this for a reloading mechanism to be marked as stable
LOG.error("Exception while trying to build the ResourceStore for URL " + root.toString(), e);
LOG.error("Consider setting struts.convention.classes.reload=false");
throw e;
}
delegate = new ResourceStoreClassLoader(parent, stores);