2015-05-20 20:30 GMT+03:00 Ed Rouse <ero...@milner.com>: > Server version: Apache Tomcat/8.0.14
A bit old... > Server built: Sep 24 2014 09:01:51 > Server number: 8.0.14.0 > OS Name: Linux > OS Version: 3.8.0-29-generic > Architecture: amd64 > JVM Version: 1.7.0_55-b14 > JVM Vendor: Oracle Corporation > > I have implemented a custom WebappClassLoaderBase and StandardRoot, and it > looks like it is working; but the resources added are not available to the > web app. What follows is a bit long and I apologize for that, but didn't want > to leave out potentially important information. Any ideas on what's wrong? At what point of Lifecycle is your code called? Has StandardRoot.initInternal() already happened? Has StandardRoot.startInternal() already happened? > This is the code snippet: > > wsRoot = IDWMPluginRegistry.getInstance().getWebRoot(); > log.info("IDWMClassLoader init: " + wsRoot.getContext().getName()); > Set<IDWMPlugin> plugins = IDWMPluginRegistry.getInstance().getPlugins(); > for(IDWMPlugin plugin: plugins) > { > log.info("Loading plugin: " + plugin.getLoaderClassName()); > try > { > if(wsRoot == null) > { > log.info("wsRoot not set."); > wsRoot = new StandardRoot(); The above code does not work. It will fail at "if(wsRoot.getContext() == null)" check on the next line... > } > if(wsRoot.getContext() == null) > { > throw new Exception("NO CONTEXT!!!!!!!"); > } > File pFile = plugin.getRoot(); > log.info("Adding plugin root " + pFile.getAbsolutePath() + " to the > WebResourceRoot as a DirResourceSet."); > > DirResourceSet drs = new DirResourceSet(wsRoot, "/", > pFile.getAbsolutePath(), "/"); > log.info("DirResourceSet base URL = " + drs.getBaseUrl().toString()); > wsRoot.addPostResources(drs); > } > catch(Exception e) > { > log.log(Level.SEVERE, "Error setting up class path", e); > } > } > > And here is the catalina.out log pertaining to this section of code. > (...) https://wiki.apache.org/tomcat/FAQ/Developing#Debugging Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org