You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Harry Hinch <hh...@acclamation.com> on 2001/11/21 22:59:41 UTC

Fwd: problem with servlet reloading


>I am running Tomcat 4 Apache 1.3.20 and Redhat linux 7.1
>
>I am having a problem with servlets reloading when ever I start Apache.  I 
>have 2 servlets that I have automatically load when tomcat starts by 
>specifying <load-on-startup>1</load-on-startup> within the <servlet> 
></servlet> pair in my applications web.xml.  I have removed the 
>stand-alone tomcat service and I only have the tomcat-Apache service.  I 
>have some logging messages in my servlets.  I notice that they appear once 
>when tomcat starts and then the start again when Apache starts.   I only 
>want the servlets to load once.  can someone please clue me in on how to 
>accomplish this.
>
>My server.xml looks like this:
>
><Server port="8005" shutdown="SHUTDOWN" debug="0">
><Service name="Tomcat-Apache">
>
>   <Connector className="org.apache.catalina.connector.warp.WarpConnector"
>    port="8008" minProcessors="5" maxProcessors="75"
>    enableLookups="true"
>    acceptCount="10" debug="0"/>
>  <Engine className="org.apache.catalina.connector.warp.WarpEngine"
>   name="Apache" debug="0" appBase="webapps">
>       <Logger className="org.apache.catalina.logger.FileLogger"
>               prefix="apache_log." suffix=".txt"
>               timestamp="true"/>
>   <Realm className="org.apache.catalina.realm.MemoryRealm" />
>      <Host name="tomcat" debug="0" appBase="webapps" unpackWARs="true">
>        <Context path="/luminx" docBase="luminx" debug="0"
>             reloadable="true">
>      <Logger className="org.apache.catalina.logger.FileLogger"
>                 prefix="tomcat_luminx_log." suffix=".txt"
>              timestamp="true"/>
>    </Context>
>       </Host>
>     </Engine>
>
>   </Service>
>
></Server>
>
>The web.xml in tomcat/conf looks line this:
><?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>
>    <servlet-name>default</servlet-name>
>    <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
>    <init-param>
>      <param-name>debug</param-name>
>      <param-value>0</param-value>
>    </init-param>
>    <init-param>
>      <param-name>listings</param-name>
>      <param-value>true</param-value>
>    </init-param>
>    <load-on-startup>1</load-on-startup>
>  </servlet>
>   <servlet>
>     <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>
>   <servlet>
>     <servlet-name>jsp</servlet-name>
>     <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
>     <init-param>
>       <param-name>logVerbosityLevel</param-name>
>       <param-value>WARNING</param-value>
>     </init-param>
>     <load-on-startup>3</load-on-startup>
>   </servlet>
>   <servlet>
>     <servlet-name>ssi</servlet-name>
> 
><servlet-class>org.apache.catalina.servlets.SsiInvokerServlet</servlet-class>
>     <init-param>
>       <param-name>buffered</param-name>
>       <param-value>1</param-value>
>     </init-param>
>     <init-param>
>       <param-name>debug</param-name>
>       <param-value>0</param-value>
>     </init-param>
>     <init-param>
>       <param-name>expires</param-name>
>       <param-value>666</param-value>
>     </init-param>
>     <init-param>
>       <param-name>isVirtualWebappRelative</param-name>
>       <param-value>0</param-value>
>     </init-param>
>   </servlet>
>   <servlet>
>     <servlet-name>cgi</servlet-name>
>     <servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
>     <init-param>
>       <param-name>clientInputTimeout</param-name>
>       <param-value>100</param-value>
>     </init-param>
>     <init-param>
>       <param-name>debug</param-name>
>       <param-value>6</param-value>
>     </init-param>
>     <init-param>
>       <param-name>cgiPathPrefix</param-name>
>       <param-value>WEB-INF/cgi</param-value>
>     </init-param>
>      <load-on-startup>5</load-on-startup>
>    </servlet>
>  <!-- The mapping for the default servlet -->
>  <servlet-mapping>
>    <servlet-name>default</servlet-name>
>    <url-pattern>/</url-pattern>
>  </servlet-mapping>
>
>
>  <!-- The mapping for the invoker servlet -->
>  <servlet-mapping>
>    <servlet-name>invoker</servlet-name>
>    <url-pattern>/luminx/*</url-pattern>
>  </servlet-mapping>
>
>
>  <!-- The mapping for the JSP servlet -->
>  <servlet-mapping>
>    <servlet-name>jsp</servlet-name>
>    <url-pattern>*.jsp</url-pattern>
>  </servlet-mapping>
>
>.....etc ...etc
>
>
>
>The web.xml in my WEB-INF looks like this:
>
><?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>
>        <servlet-name>RefreshConnections</servlet-name>
>        <servlet-class>RefreshConnections</servlet-class>
>        <load-on-startup>5</load-on-startup>
>    </servlet>
>   <servlet-mapping>
>       <servlet-name>
>            RefreshConnections
>       </servlet-name>
>       <url-pattern>
>            /RefreshConnections
>       </url-pattern>
>   </servlet-mapping>
>...etc ....
>
>
>

Re: Fwd: problem with servlet reloading

Posted by Gerard van Enk <ge...@eo.nl>.
Harry Hinch wrote:

> 
> 
>> I am running Tomcat 4 Apache 1.3.20 and Redhat linux 7.1
>>
>> I am having a problem with servlets reloading when ever I start 
>> Apache.  I have 2 servlets that I have automatically load when tomcat 
>> starts by specifying <load-on-startup>1</load-on-startup> within the 
>> <servlet> </servlet> pair in my applications web.xml.  I have removed 
>> the stand-alone tomcat service and I only have the tomcat-Apache 
>> service.  I have some logging messages in my servlets.  I notice that 
>> they appear once when tomcat starts and then the start again when 
>> Apache starts.   I only want the servlets to load once.  can someone 
>> please clue me in on how to accomplish this.


I've got the same problem (I already started to write an email about it 
:) ). It looks like the whole web application is deployed again after 
Apache starts, and it has got something to do with the mod_webapp I think.
I didn't remove the stand-alone tomcat service.

Gerard



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>