From: Marc P. <ma...@an...> - 2003-07-23 10:14:29
|
Guys, I imagine a few of use are familiar with this message after trying to replace webmacro.jar and restarting/reloading the web application without restarting the servlet container: WebMacro Error: Could not initialize the broker! *** Check that WebMacro.properties was in your servlet *** classpath, in a similar place to webmacro.jar *** and that all values were set correctly. IO Error reading WebMacro.defaults java.io.FileNotFoundException: JAR entry WebMacro.defaults not found in E:\Program Files\Apache Group\Tomcat 4.1\webapps\ignition\WEB- INF\lib\webmacro.jar Please contact the server administrator Do we know why this is happening? It is hard to see how it can be a WM thing, as it looks more like a generic classloader issue. However I think this is a pretty serious problem we need to address, because it is really bad news if you have to ask a network admin to restart a shared Tomcat instance, thus bringing down everybody else's sites. It looks like the problem is occurring here in Settings: public void load (String fileName) throws InitException, IOException { ClassLoader cl = this.getClass().getClassLoader(); URL u = (cl == null) ? null : cl.getResource(fileName); if (u == null) u = ClassLoader.getSystemResource(fileName); if (u == null) try { u = new URL("file:" + fileName); } catch (MalformedURLException e) { } ; .... } Now, as the webapp is being reloaded by the container, everything should be running on top of a new ClassLoader and therefore this probably should work fine. Perhaps there is some strange issue here with servlet containers (this is seen in Tomcat 4.1.18, 4.1.24 and I think Eric said Resin 2.x too) that we could work around by using ServletContext.getResource in Settings? This would mean refactoring Settings to pass in the URL instead of the filename, which could be a good thing - putting the responsibility of finding the file on the caller (Broker). Anybody think they might know what's going on here? Marc -- Marc Palmer Contract Java Consultant/Developer w a n g j a m m e r s java and web software design experts with an ethical outlook http://www.wangjammers.org |