tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@projektinter.net
Subject Problem Loading Servlet on Server startup
Date Fri, 13 Sep 2002 11:11:34 GMT
Hi,

below is my current web.xml listed.
As the first Servlet I am loading the InitAppServlet. The init(cfg ServletConfig) Methode
lookes like:

   public void init(ServletConfig cfg) throws ServletException 
     {
          this.cfg = cfg;
          this.ctx = cfg.getServletContext();
          //initApp();
  
     }//init()

When I startup the application I get an Exception form the destroy() methode of the InitAppServlet
is thrown.
You can see below the thrown Execption
As a strange thing: it already used to work!

Does anyone have an idea?

I am using Tomcat 4.0.1 on a Linux SuSE 7.3 Box, JDK 1.3.1

thanks, rainer

#####################################
Exception:

Servlet InitAppServlet threw unload() exception
javax.servlet.ServletException: Servlet.destroy() for servlet InitAppServlet threw exception
 at org.apache.catalina.core.StandardWrapper.unload(StandardWrapper.java:1020)
 at org.apache.catalina.core.StandardWrapper.stop(StandardWrapper.java:1193)
 at org.apache.catalina.core.StandardContext.reload(StandardContext.java:2381)
 at org.apache.catalina.servlets.ManagerServlet.reload(ManagerServlet.java:448)
 at org.apache.catalina.servlets.ManagerServlet.doGet(ManagerServlet.java:281)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
 at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
 at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:518)
 at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
 at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
 at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
 at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
 at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
 at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
 at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
 at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
 at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
 at java.lang.Thread.run(Thread.java:484)
----- Root Cause -----
java.lang.NullPointerException
 at javax.servlet.GenericServlet.getServletContext(GenericServlet.java:205)
 at javax.servlet.GenericServlet.log(GenericServlet.java:300)
 at javax.servlet.GenericServlet.destroy(GenericServlet.java:122)
 at org.apache.catalina.core.StandardWrapper.unload(StandardWrapper.java:1011)
 at org.apache.catalina.core.StandardWrapper.stop(StandardWrapper.java:1193)
 at org.apache.catalina.core.StandardContext.reload(StandardContext.java:2381)
 at org.apache.catalina.servlets.ManagerServlet.reload(ManagerServlet.java:448)
 at org.apache.catalina.servlets.ManagerServlet.doGet(ManagerServlet.java:281)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
 at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
 at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:518)
 at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
 at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
 at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
 at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
 at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
 at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
 at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
 at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
 at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
 at java.lang.Thread.run(Thread.java:484)

###########################################################

web.xml:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>

 <context-param>
  <param-name>mapserver_pfad</param-name>
  <param-value>http://jspserver</param-value>
  <!-- <param-value>http://development.projektinter.net/</param-value> -->
  <description>MapServer-Pfad</description>
 </context-param>
 <context-param>
  <param-name>mapserver_cgi_pfad</param-name>
  <param-value>/cgi-bin/mapserv</param-value>
  <description>MapServer CGI Pfad</description>
 </context-param>
 <context-param>
  <param-name>apache_pfad</param-name>
  <param-value>%2Fusr%2Flocal%2Fhttpd%2Fhtdocs%2F</param-value>
  <description>Pfad zum Apache Server unter dem sich das mapserver Verzichnis befindet</description>
 </context-param>
 <context-param>
  <param-name>tomcat_pfad</param-name>
  <param-value>%2Fusr%2Flib%2Fjakarta-tomcat-4.0.1%2F</param-value>
  <description>Pfad des Tomcat Wurzelverzeichnis</description>
 </context-param>
 <context-param>
  <param-name>application_name</param-name>
  <param-value>wwa-m</param-value>
  <description>Name der Application</description>
 </context-param>

   <servlet>
    <servlet-name>InitAppServlet</servlet-name>
    <servlet-class>net.projektinter.wwam.util.InitAppServlet</servlet-class>
    <init-param>
      <param-name>fileName</param-name>
      <param-value>system.out.println</param-value>
 </init-param>
 <init-param>
   <param-name>logLevel</param-name>
      <param-value>debug</param-value>
    </init-param>
 <init-param>
   <param-name>dbUrl</param-name>
      <param-value>jdbc:mysql://localhost:3306</param-value>
    </init-param>
 <init-param>
   <param-name>dbName</param-name>
      <param-value>wwa_m01</param-value>
    </init-param>
 <init-param>
   <param-name>dbDriver</param-name>
      <param-value>org.gjt.mm.mysql.Driver</param-value>
    </init-param>
 <init-param>
   <param-name>dbPassword</param-name>
      <param-value></param-value>
    </init-param>
 <init-param>
   <param-name>dbUser</param-name>
      <param-value>root</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  

  <!-- Standard Action Servlet Configuration (with debugging) -->
   <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>PIActionServlet</servlet-class>
    <init-param>
      <param-name>application</param-name>
      <param-value>ApplicationResources</param-value>
    </init-param>
    <init-param>
      <param-name>config</param-name>
      <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <init-param>
      <param-name>debug</param-name>
      <param-value>2</param-value>
    </init-param>
    <init-param>
      <param-name>detail</param-name>
      <param-value>1</param-value>
    </init-param>
    <init-param>
      <param-name>validate</param-name>
      <param-value>true</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
  </servlet>

  <!-- Standard Action Servlet Mapping -->
   <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>/app/*</url-pattern>
  </servlet-mapping>


  <!-- Struts Tag Library Descriptors -->
  <taglib>
    <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
  </taglib>

  <taglib>
    <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
  </taglib>

  <taglib>
    <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
  </taglib>
  
  <taglib>
    <taglib-uri>/WEB-INF/struts-form.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-form.tld</taglib-location>
  </taglib>
  
   <taglib>
    <taglib-uri>/WEB-INF/struts.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts.tld</taglib-location>
  </taglib>
  
 <taglib>
    <taglib-uri>/WEB-INF/logon.tld</taglib-uri>
    <taglib-location>/WEB-INF/logon.tld</taglib-location>
  </taglib>
 <resource-ref>
 <description>
    Resource reference to a factory for java.sql.Connection
    instances that may be used for talking to a particular
    database that is configured in the server.xml file.
  </description>
  <res-ref-name>jdbc/wwa-mDB</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <res-auth>Container</res-auth>
</resource-ref>
 
</web-app>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message