0 Replies Latest reply on Jul 7, 2005 5:11 PM by garym

    Error during restartContext

    garym

      Still have an issue with restartContext and finally got around to creating a sample to recreate it:

      Error for the sample shows:

      09:10:51,234 INFO [HostConfig] restartContext(/check)
      09:10:51,250 INFO [Context] Reloading this Context has started
      09:10:51,265 WARN [HostConfig] Error during context /check restart
      java.lang.NullPointerException
      at org.jboss.web.tomcat.tc5.WebCtxLoader.start(WebCtxLoader.java:109)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
      231)
      at org.apache.catalina.core.StandardContext.reload(StandardContext.java:
      3043)
      at org.apache.catalina.startup.HostConfig.restartContext(HostConfig.java
      :873)
      at org.apache.catalina.startup.HostConfig.checkContextLastModified(HostC
      onfig.java:759)
      at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1085)
      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
      :327)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
      eSupport.java:119)
      at org.apache.catalina.core.StandardHost.backgroundProcess(StandardHost.
      java:800)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.p
      rocessChildren(ContainerBase.java:1619)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.p
      rocessChildren(ContainerBase.java:1628)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.r
      un(ContainerBase.java:1608)
      at java.lang.Thread.run(Thread.java:534)
      


      web.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE web-app
       PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
       "http://java.sun.com/dtd/web-app_2_3.dtd">
      
      <web-app>
       <display-name>hello-world</display-name>
      
       <description>
       My Hello World servlet.
       </description>
      
       <servlet>
       <servlet-name>hello-world</servlet-name>
       <servlet-class>test.HelloServlet</servlet-class>
       </servlet>
      
       <servlet-mapping>
       <servlet-name>hello-world</servlet-name>
       <url-pattern>/test/hello-world</url-pattern>
       </servlet-mapping>
      </web-app>


      Host settings in Server.xml:

      <Host name="localhost" autoDeploy="true" deployOnStartup="false" deployXML="false">
      
       <!-- Default context parameters -->
       <DefaultContext cookies="true" crossContext="true" override="true" reloadable="true"/>
      
       </Host>
      


      HelloServlet:

      package test;
      
      import java.io.*;
      import javax.servlet.http.*;
      import javax.servlet.*;
      
      public class HelloServlet extends HttpServlet
      {
      
       public void init() throws ServletException
       {
       }
      
       public void doGet ( HttpServletRequest request,
       HttpServletResponse response)
       throws ServletException, IOException
       {
       PrintWriter out = response.getWriter();
      
       out.println("Hello, betty!");
       out.close();
       }
      }
      


      No context.xml.

      To get the error just touch the web.xml.

      Running 3.2.6 with Tomcat 5.0. Let me know if I need to post any other settings.

      Are we missing a necessary setting to get this to work?

      Any direction would be appreciated!

      garym