3 Replies Latest reply on Oct 19, 2005 10:41 PM by Scott Stark

    servlet cannot work after upgrade from 4.02 to 4.03

    tissues Newbie

      java.lang.NullPointerException
      org.jboss.web.tomcat.security.RunAsListener.instanceEvent(RunAsListener.java:53)
      org.apache.catalina.util.InstanceSupport.fireInstanceEvent(InstanceSupport.java:266)
      org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:369)
      org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:133)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)

      ============================
      It show above error msg after upgrade from 4.02 to 4.03
      what's wrong?...

      thx..

        • 1. Re: servlet cannot work after upgrade from 4.02 to 4.03
          Scott Stark Master

          Need the details of what is being done when this occurs.

          • 2. Re: servlet cannot work after upgrade from 4.02 to 4.03
            tissues Newbie

            all the servlet program cannot work and show above error message after upgrade from 4.02 to 4.03

            Is any extra configure need to do for 4.0.3?
            I cannot invoke any servlet program at 4.0.3 while it was work fine on 4.0.2 or older version...

            Thanks...


            The config file for servlet

            WEB-INF/web.xml
            =========================
            <?xml version="1.0" encoding="ISO-8859-1"?>
            <!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>

            <servlet-name>invoker</servlet-name>
            <servlet-class>
            org.apache.catalina.servlets.InvokerServlet
            </servlet-class>
            <init-param>
            <param-name>debug</param-name>
            <param-value>0</param-value>
            </init-param>
            <load-on-startup>2</load-on-startup>


            <servlet-mapping>
            <servlet-name>invoker</servlet-name>
            <url-pattern>/servlet/*</url-pattern>
            </servlet-mapping>

            <session-config>
            <session-timeout>30</session-timeout>
            </session-config>
            </web-app>
            =========================


            The servlet program:

            WEB-INF/classes/examples/Hello.java
            =========================
            ackage examples;

            import java.io.*;
            import java.text.*;
            import java.util.*;
            import javax.servlet.*;
            import javax.servlet.http.*;
            /**
            * The simplest possible servlet.
            *
            * @author James Duncan Davidson
            */
            public class Hello extends HttpServlet {
            public void doGet(HttpServletRequest request,
            HttpServletResponse response)
            throws IOException, ServletException
            {
            response.setContentType("text/html");
            PrintWriter out = response.getWriter();

            out.println("");
            out.println("");

            String title = "Hello World!";

            out.println("" + title + "");
            out.println("");
            out.println("<body bgcolor=\"white\">");

            out.println("<h1>" + title + "</h1>");
            out.println("");
            out.println("");
            }
            }
            =========================

            • 3. Re: servlet cannot work after upgrade from 4.02 to 4.03
              Scott Stark Master

              The invoker servlet is not compatible with the RunAsListener because it bypasses the normal servlet creation process. You need to comment out the RunAsListener in the jbossweb-tomcat55.sar/context.xml descriptor:

              <!-- The contents of this file will be loaded for each web application -->
              <Context cookies="true" crossContext="true">
               <!-- Session persistence is disable by default. To enable for all web
               apps set the pathname to a non-empty value:
               <Manager pathname="SESSIONS.ser" />
              
               To enable session persistence for a single web app, add a
               WEB-INF/context.xml
               -->
               <Manager pathname="" />
              
               <!-- Install an InstanceListener to handle the establishment of the run-as
               role for servlet init/destroy events. <InstanceListener>org.jboss.web.tomcat.security.RunAsListener</InstanceListener>
               -->
              
              </Context>