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 |
From: Brian G. <br...@qu...> - 2003-07-23 19:08:27
|
> 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: Great question. I think this is worth spending some effort on -- much more worthwhile than debating about whether or not to kill Context tools :) |
From: Sebastian K. <seb...@mu...> - 2003-07-24 09:57:23
|
Hi, On Wednesday 23 July 2003 12:11, Marc Palmer wrote: > 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. I've tried to track this down the last two hours, but I have no clue. I did the following to get a minimal test case. I modified Standalone.java from our examples slightly, so that it worked as expected: - Passed a "this" reference in new WM() - called super.init(sc) at the beginning of the overriden init method I then created a simple web-app with the following files: webapps/test/standalone.wm webapps/WEB-INF/web.xml webapps/WEB-INF/classes/Standalone.class webapps/WEB-INF/lib/webmacro.jar This works as expected. When I "touch" webmacro.jar the webapp gets reloaded and everything works as expected. However, when I change a core WebMacro class sligthly, so that the size of webmacro.jar changes and put this modified webmacro.jar in place, things fails after reloading the webapp. However, I'm getting another message than Marc which really hints at a classloader issue: avax.servlet.ServletException: Error instantiating servlet class Standalone at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:912) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:668) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619) at java.lang.Thread.run(Thread.java:484) ----- Root Cause ----- java.lang.NoClassDefFoundError: org/webmacro/ContextException at java.lang.Class.newInstance0(Native Method) at java.lang.Class.newInstance(Class.java:237) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:903) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:668) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619) at java.lang.Thread.run(Thread.java:484) Notice the root cause: "java.lang.NoClassDefFoundError: org/webmacro/ContextException" Needless to say, that I did not do anything to ContextException. I have no idea what's going on here, or how to track this down. This all happens under tomcat-4.1.24 Sebastian -- Sebastian Kanthak PGP/GnuPG: http://www.muehlheim.de/~skanthak/pgp.html |
From: Marc P. <ma...@an...> - 2003-07-24 10:33:21
|
On Thu, 24 Jul 2003 11:56:29 +0200, Sebastian Kanthak <seb...@mu...> wrote: > I've tried to track this down the last two hours, but I have no clue. I > did the following to get a minimal test case. Sebastian, thanks for spending some time on it! The error you get is different probably just because I am based on WMServlet and you are based on Standalone. This is very strange though, because we know for a fact that other JARs are reloaded fine in Tomcat and Resin. So there must be something specific to webmacro.jar that is different. It does not look like some strange classloader usage issue -within- WM code though, which was possible with my flavour of the problem, because yours is a class loading (rather than resource) problem. The "touch" working without problem sounds to me like there might be some intelligence going on in the classloader, or because no code has actually changed it continues to work with the previous code on the previous classloader perhaps. This is all speculation but that's all we have right now! I'll see if I can see anything in the way the jar is built. I know, I must be crazy... but maybe its a problem with reloading zipped JARs vs unzipped jars for example. 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 |