You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Svein Petter Larsen <sp...@scandpower.no> on 2000/07/13 14:39:52 UTC

Servlet reloading once more

Trying again

This is eating up a lot of my time so I try to ask once more..

 How can I set up Tomcat 3.1 to autoreload servlets? 
 Every time I compile my servlet I have to stop and restart my Tomcat to get the
 new class up and running.
 I have tried to put in the string in the file "server.xml" which says:
   	<Context path="/sis" docBase="webapps/sis" debug="0" reloadable="true" >
         	</Context> 
 where sis is my app. and it is under $TOMCAT_HOME/webapps/sis
 It did not work...
 
 
 It is timeconsuming to stop and start Tomcat on every compile :-( 
 
 Is there an solutions?


------------------------------------------------------------------------------------------
My web.xml under $TOMCAT_HOME/webapps/sis file look like:

<?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>

        <display-name>Subject Information System</display-name>
        <description>
        this is version 1.0 of SIS
        </description>

        <context-param>
        <param-name>webmaster</param-name>
        <param-value>spla@scandpower.no</param-value>
        <description>
        The EMAIL address of the administrator to whom questions
        and comments about this application should be addressed.
        </description>
        </context-param>     

<!-- Define the default session timeout for your application,
         in minutes.  From a servlet or JSP page, you can modify
         the timeout for a particular session dynamically by using
         HttpSession.getMaxInactiveInterval(). -->

        <session-config>
          <session-timeout>30</session-timeout>    <!-- 30 minutes -->
        </session-config>
</web-app>

--------------------------------------------------------------------------------------------

My server.xml file under $TOMCAT_HOME/conf look like:
<?xml version="1.0" encoding="ISO-8859-1"?>

<Server>
    <!-- Debug low-level events in XmlMapper startup -->
    <xmlmapper:debug level="0" />

    <!-- This is quite flexible; we can either have a log file per
         module in Tomcat (example: ContextManager) or we can have
         one for Servlets and one for Jasper, or we can just have
         one tomcat.log for both Servlet and Jasper.

         If you omit "path" there, then stderr should be used.

         verbosityLevel values can be:
            FATAL
            ERROR
            WARNING
            INFORMATION
            DEBUG
         -->

    <Logger name="tc_log"
            path="logs/tomcat.log"
            customOutput="yes" />

    <Logger name="servlet_log"
            path="logs/servlet.log"
            customOutput="yes" />

    <Logger name="JASPER_LOG"
            path="logs/jasper.log"
            verbosityLevel = "INFORMATION" />

    <!-- Add "home" attribute if you want tomcat to be based on a different directory
         "home" is used to create work and to read webapps, but not for libs or CLASSPATH.
         Note that TOMCAT_HOME is where tomcat is installed, while ContextManager home is the
         base directory for contexts, webapps/ and work/
      -->
    <ContextManager debug="0" workDir="work" >
        <!-- ContextInterceptor className="org.apache.tomcat.context.LogEvents" / -->
        <ContextInterceptor className="org.apache.tomcat.context.AutoSetup" />
        <ContextInterceptor className="org.apache.tomcat.context.DefaultCMSetter" />
        <ContextInterceptor className="org.apache.tomcat.context.WorkDirInterceptor" />
        <ContextInterceptor className="org.apache.tomcat.context.WebXmlReader" />
        <ContextInterceptor className="org.apache.tomcat.context.LoadOnStartupInterceptor" />
        <!-- Request processing -->
        <RequestInterceptor className="org.apache.tomcat.request.SimpleMapper" debug="0" />
        <RequestInterceptor className="org.apache.tomcat.request.SessionInterceptor" />
        <RequestInterceptor className="org.apache.tomcat.request.SecurityCheck" />
        <RequestInterceptor className="org.apache.tomcat.request.FixHeaders" />

       <!--
         <Connector className="org.apache.tomcat.service.SimpleTcpConnector">
            <Parameter name="handler" value="org.apache.tomcat.service.http.HttpConnectionHandler"/>
            <Parameter name="port" value="8080"/>
        </Connector>
        -->

        <Connector className="org.apache.tomcat.service.SimpleTcpConnector">
            <Parameter name="handler" value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/>

            <Parameter name="port" value="8007"/>
        </Connector>


        <!-- example - how to override AutoSetup actions -->
        <Context path="/examples" docBase="webapps/examples" debug="0" reloadable="true" >
        </Context>
        <!-- example - how to override AutoSetup actions -->
        <Context path="" docBase="webapps/ROOT" debug="0" reloadable="true" >
        </Context>

    <Context path="/test" docBase="webapps/test" debug="0" reloadable="true">
         </Context>

        <Context path="/sis" docBase="webapps/sis" debug="0" reloadable="true" >
        </Context>

    </ContextManager>
</Server>           

-- 

================,,,=========================
===============(o o)========================
===========oOO==(_)==OOo====================

Petter Larsen
Institutt for informatikk,
Universitetet i Oslo

sveinpe@ifi.uio.no
http://www.stud.ifi.uio.no/~sveinpe

Linux is best..:-)

===========ooooO==Ooooo=====================
===========(   )==(   )=====================
============\ (====) /======================
=============\_)==(_/=======================

Re: Servlet reloading once more

Posted by Xander Heemskerk <xh...@factotum.nl>.
Under NT it is not possible!

----- Original Message -----
From: "Svein Petter Larsen" <sp...@scandpower.no>
To: <to...@jakarta.apache.org>
Sent: Thursday, July 13, 2000 2:39 PM
Subject: Servlet reloading once more


> Trying again
>
> This is eating up a lot of my time so I try to ask once more..
>
>  How can I set up Tomcat 3.1 to autoreload servlets?
>  Every time I compile my servlet I have to stop and restart my Tomcat to
get the
>  new class up and running.
>  I have tried to put in the string in the file "server.xml" which says:
>    <Context path="/sis" docBase="webapps/sis" debug="0" reloadable="true"
>
>          </Context>
>  where sis is my app. and it is under $TOMCAT_HOME/webapps/sis
>  It did not work...
>
>
>  It is timeconsuming to stop and start Tomcat on every compile

>
>  Is there an solutions?
>
>
> --------------------------------------------------------------------------
----------------
> My web.xml under $TOMCAT_HOME/webapps/sis file look like:
>
> <?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>
>
>         <display-name>Subject Information System</display-name>
>         <description>
>         this is version 1.0 of SIS
>         </description>
>
>         <context-param>
>         <param-name>webmaster</param-name>
>         <param-value>spla@scandpower.no</param-value>
>         <description>
>         The EMAIL address of the administrator to whom questions
>         and comments about this application should be addressed.
>         </description>
>         </context-param>
>
> <!-- Define the default session timeout for your application,
>          in minutes.  From a servlet or JSP page, you can modify
>          the timeout for a particular session dynamically by using
>          HttpSession.getMaxInactiveInterval(). -->
>
>         <session-config>
>           <session-timeout>30</session-timeout>    <!-- 30 minutes -->
>         </session-config>
> </web-app>
>
> --------------------------------------------------------------------------
------------------
>
> My server.xml file under $TOMCAT_HOME/conf look like:
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <Server>
>     <!-- Debug low-level events in XmlMapper startup -->
>     <xmlmapper:debug level="0" />
>
>     <!-- This is quite flexible; we can either have a log file per
>          module in Tomcat (example: ContextManager) or we can have
>          one for Servlets and one for Jasper, or we can just have
>          one tomcat.log for both Servlet and Jasper.
>
>          If you omit "path" there, then stderr should be used.
>
>          verbosityLevel values can be:
>             FATAL
>             ERROR
>             WARNING
>             INFORMATION
>             DEBUG
>          -->
>
>     <Logger name="tc_log"
>             path="logs/tomcat.log"
>             customOutput="yes" />
>
>     <Logger name="servlet_log"
>             path="logs/servlet.log"
>             customOutput="yes" />
>
>     <Logger name="JASPER_LOG"
>             path="logs/jasper.log"
>             verbosityLevel = "INFORMATION" />
>
>     <!-- Add "home" attribute if you want tomcat to be based on a
different directory
>          "home" is used to create work and to read webapps, but not for
libs or CLASSPATH.
>          Note that TOMCAT_HOME is where tomcat is installed, while
ContextManager home is the
>          base directory for contexts, webapps/ and work/
>       -->
>     <ContextManager debug="0" workDir="work" >
>         <!-- ContextInterceptor
className="org.apache.tomcat.context.LogEvents" / -->
>         <ContextInterceptor
className="org.apache.tomcat.context.AutoSetup" />
>         <ContextInterceptor
className="org.apache.tomcat.context.DefaultCMSetter" />
>         <ContextInterceptor
className="org.apache.tomcat.context.WorkDirInterceptor" />
>         <ContextInterceptor
className="org.apache.tomcat.context.WebXmlReader" />
>         <ContextInterceptor
className="org.apache.tomcat.context.LoadOnStartupInterceptor" />
>         <!-- Request processing -->
>         <RequestInterceptor
className="org.apache.tomcat.request.SimpleMapper" debug="0" />
>         <RequestInterceptor
className="org.apache.tomcat.request.SessionInterceptor" />
>         <RequestInterceptor
className="org.apache.tomcat.request.SecurityCheck" />
>         <RequestInterceptor
className="org.apache.tomcat.request.FixHeaders" />
>
>        <!--
>          <Connector
className="org.apache.tomcat.service.SimpleTcpConnector">
>             <Parameter name="handler"
value="org.apache.tomcat.service.http.HttpConnectionHandler"/>
>             <Parameter name="port" value="8080"/>
>         </Connector>
>         -->
>
>         <Connector
className="org.apache.tomcat.service.SimpleTcpConnector">
>             <Parameter name="handler"
value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/>
>
>             <Parameter name="port" value="8007"/>
>         </Connector>
>
>
>         <!-- example - how to override AutoSetup actions -->
>         <Context path="/examples" docBase="webapps/examples" debug="0"
reloadable="true" >
>         </Context>
>         <!-- example - how to override AutoSetup actions -->
>         <Context path="" docBase="webapps/ROOT" debug="0"
reloadable="true" >
>         </Context>
>
>     <Context path="/test" docBase="webapps/test" debug="0"
reloadable="true">
>          </Context>
>
>         <Context path="/sis" docBase="webapps/sis" debug="0"
reloadable="true" >
>         </Context>
>
>     </ContextManager>
> </Server>
>
> --
>
> ================,,,=========================
> ===============(o o)========================
> ===========oOO==(_)==OOo====================
>
> Petter Larsen
> Institutt for informatikk,
> Universitetet i Oslo
>
> sveinpe@ifi.uio.no
> http://www.stud.ifi.uio.no/~sveinpe
>
> Linux is best..:-)
>
> ===========ooooO==Ooooo=====================
> ===========(   )==(   )=====================
> ============\ (====) /======================
> =============\_)==(_/=======================
>


Re: JSP okay but Servlets not found

Posted by "D.Yutzy" <dy...@copper.net>.
I gave up and tried Jrun, reloading worked immediately and without any 
fumbling around for the right combination.  That feature alone has me 
dumping Tomcat.  Reloading on the fly after compile was a BIG reason over 
using DLL's.

>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 7/13/2000, 10:32:00 AM, Mason Jones <ma...@clipshow.com> wrote regarding 
Re: JSP okay but Servlets not found:


> Well, naturally not long after I sent in this question, I managed
> to stumble on the right combination of things. Perhaps I'll try to
> write up what I did and send it out to the list in case other people
> are having similar troubles. The FAQ did help, but I still had to
> experiment with quite a few different combinations of setups
> before I happened on the one that worked. But all's well that
> ends well.

> At 02:04 PM 7/13/00 -0700, Mason Jones wrote:
> >
> >I'm having a fairly simple problem (I expect) getting servlets
> >to run correctly. My JSP pages are running fine -- all of the
> >classes are being found, etc. But I think I'm simply not quite
> >clear on how servlets are found by Tomcat. When I try to
> >access a servlet I get a 404 error. Does anyone out there have
> >a straightforward set of documentation for how to set up a
> >servlet context, edit all the files necessary, and so forth?
> >
> >A related question is whether, given the context from which
> >I'm serving the jsp pages, there's a simple change to use
> >servlets in the same WEB-INF/classes directory? I've got the
> >test servlet defined in the WEB-INF/web.xml file, but that
> >doesn't seem to be enough...
> >
> >Thanks for any help.



> ________________________________________
>   Mason Jones              mason(at)clipshow.com
>   Director of Software Development
>   ClipShow, Inc.            www.clipshow.com
>   (650) 696-3164           fax (650) 696-3267

Re: JSP okay but Servlets not found

Posted by Mason Jones <ma...@clipshow.com>.
Well, naturally not long after I sent in this question, I managed
to stumble on the right combination of things. Perhaps I'll try to
write up what I did and send it out to the list in case other people
are having similar troubles. The FAQ did help, but I still had to
experiment with quite a few different combinations of setups
before I happened on the one that worked. But all's well that
ends well.

At 02:04 PM 7/13/00 -0700, Mason Jones wrote:
>
>I'm having a fairly simple problem (I expect) getting servlets
>to run correctly. My JSP pages are running fine -- all of the
>classes are being found, etc. But I think I'm simply not quite
>clear on how servlets are found by Tomcat. When I try to
>access a servlet I get a 404 error. Does anyone out there have
>a straightforward set of documentation for how to set up a
>servlet context, edit all the files necessary, and so forth?
>
>A related question is whether, given the context from which
>I'm serving the jsp pages, there's a simple change to use
>servlets in the same WEB-INF/classes directory? I've got the
>test servlet defined in the WEB-INF/web.xml file, but that
>doesn't seem to be enough...
>
>Thanks for any help.



________________________________________
  Mason Jones              mason(at)clipshow.com
  Director of Software Development
  ClipShow, Inc.            www.clipshow.com
  (650) 696-3164           fax (650) 696-3267


JSP okay but Servlets not found

Posted by Mason Jones <ma...@clipshow.com>.
I'm having a fairly simple problem (I expect) getting servlets
to run correctly. My JSP pages are running fine -- all of the
classes are being found, etc. But I think I'm simply not quite
clear on how servlets are found by Tomcat. When I try to
access a servlet I get a 404 error. Does anyone out there have
a straightforward set of documentation for how to set up a
servlet context, edit all the files necessary, and so forth?

A related question is whether, given the context from which
I'm serving the jsp pages, there's a simple change to use
servlets in the same WEB-INF/classes directory? I've got the
test servlet defined in the WEB-INF/web.xml file, but that
doesn't seem to be enough...

Thanks for any help.



________________________________________
  Mason Jones              mason(at)clipshow.com
  Director of Software Development
  ClipShow, Inc.            www.clipshow.com
  (650) 696-3164           fax (650) 696-3267


Re: Servlet reloading once more

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Mason Jones wrote:

> Craig McClanahan wrote:
> >Matthew Lyons wrote:
> >
> >> It includes the project classes in the classpath. Does TomCat
> >> autoreload classes in the classpath?
> >
> >No.  Auto-reloading (to the extent that it works -- there are bugs if
> >you have
> >more than one servlet running) can only reload classes that it loaded
> >from
> >WEB-INF/classes or WEB-INF/lib/*.jar in your web application.  You will
> >need to
> >make sure that JBuilder stores the servlet classes in one of these
> >places.
>
> Does this mean that if I have classes in a package under
> WEB-INF/classes, they won't be reloaded? That's what I'm
> seeing. I've got WEB-INF/classes/clipshow and most of my
> classes under there, and they're not being reloaded. I do have
> "reloadable=true" in my server.xml file. Do I need to make a
> lib/clipshow.jar file instead, in order to get the classes to reload?
>

Classes in packages are treated identically (with respect to reloading) to
classes not in packages.  In other words, if you have a class "MyClass" in
package "clipshow", the class file itself should be
"WEB-INF/classes/clipshow/MyClass.class".

One thing to triple check is that there is no occurrence of
"clipshow.MyClass" anywhere on your class path.  If there is, the class will
be loaded from there instead, and thus not be subject to reload checking.

>
> ________________________________________
>   Mason Jones              mason(at)clipshow.com
>   Director of Software Development
>   ClipShow, Inc.            www.clipshow.com
>   (650) 696-3164           fax (650) 696-3267

Craig McClanahan



Re: Servlet reloading once more

Posted by Mason Jones <ma...@clipshow.com>.
Craig McClanahan wrote:
>Matthew Lyons wrote:
>
>> It includes the project classes in the classpath. Does TomCat
>> autoreload classes in the classpath?
>
>No.  Auto-reloading (to the extent that it works -- there are bugs if
>you have
>more than one servlet running) can only reload classes that it loaded
>from
>WEB-INF/classes or WEB-INF/lib/*.jar in your web application.  You will
>need to
>make sure that JBuilder stores the servlet classes in one of these
>places.

Does this mean that if I have classes in a package under
WEB-INF/classes, they won't be reloaded? That's what I'm
seeing. I've got WEB-INF/classes/clipshow and most of my
classes under there, and they're not being reloaded. I do have
"reloadable=true" in my server.xml file. Do I need to make a
lib/clipshow.jar file instead, in order to get the classes to reload?



________________________________________
  Mason Jones              mason(at)clipshow.com
  Director of Software Development
  ClipShow, Inc.            www.clipshow.com
  (650) 696-3164           fax (650) 696-3267


Re: Servlet reloading once more

Posted by Mason Jones <ma...@clipshow.com>.
Svein Petter Larsen wrote:
>
>Does that mean that it does not work? I have tested with only one servlet 
>loaded
>and it work some times and some times not...
>It look like I have made the configuration files right, but it will still not
>work. I am running Tomcat 3.1, maybe I have to try 3.2b2....

I finally have the class reloading working. The key seemed to be
to make sure that the classes I want to be reloaded are in the
WEB-INF/classes directory (or a subdirectory of it), and NOT
in the CLASSPATH with which tomcat was started. What I did was
modify the bin/startup.sh script to set the CLASSPATH and export
it before running the tomcat.sh script. That seems to have helped
me ensure that the classes are only found in the WEB-INF by
tomcat, and now they're reloading as expected.

Hope that helps you.



________________________________________
  Mason Jones              mason(at)clipshow.com
  Director of Software Development
  ClipShow, Inc.            www.clipshow.com
  (650) 696-3164           fax (650) 696-3267


Re: Servlet reloading once more

Posted by Matthew Lyons <ma...@trifast-systems.co.uk>.
> Does that mean that it does not work? I have tested with only one servlet
loaded
> and it work some times and some times not...
> It look like I have made the configuration files right, but it will still
not
> work. I am running Tomcat 3.1, maybe I have to try 3.2b2....
>

I have just been experimenting with this in 3.1. It looks to me like if you
have your WEB-INF/classes directory in your classpath when starting TomCat
or if you have the same class anywhere else in your classpath then
autoreload won't work. Check that your classpath doesn't include any of your
servlet classes.
---
Matt Lyons
Trifast Systems Ltd


Re: Servlet reloading once more

Posted by Svein Petter Larsen <sp...@scandpower.no>.
On Thu, 13 Jul 2000, you wrote:
> Matthew Lyons wrote:
> 
> > > Set reloadable to true for that context in the server.xml file
> >
> > It looks like he has already done this.
> >
> > > >         <Context path="/sis" docBase="webapps/sis" debug="0"
> > > > reloadable="true" >
> >
> > So have I and I can't get the classes to autoreload either. Is it something
> > to do with the way TomCat is started? In my case JBuilder is starting
> > TomCat. It includes the project classes in the classpath. Does TomCat
> > autoreload classes in the classpath?
> >
> 
> No.  Auto-reloading (to the extent that it works -- there are bugs if
> you have
> more than one servlet running) can only reload classes that it loaded
> from
> WEB-INF/classes or WEB-INF/lib/*.jar in your web application.  You will
> need to
> make sure that JBuilder stores the servlet classes in one of these
> places.
> 
> Craig McClanahan

Does that mean that it does not work? I have tested with only one servlet loaded
and it work some times and some times not...
It look like I have made the configuration files right, but it will still not
work. I am running Tomcat 3.1, maybe I have to try 3.2b2....

 -- 

================,,,=========================
===============(o o)========================
===========oOO==(_)==OOo====================

Petter Larsen
Institutt for informatikk,
Universitetet i Oslo

sveinpe@ifi.uio.no
http://www.stud.ifi.uio.no/~sveinpe

Linux is best..:-)

===========ooooO==Ooooo=====================
===========(   )==(   )=====================
============\ (====) /======================
=============\_)==(_/=======================

ServletContext vs PageContext

Posted by Mason Jones <ma...@clipshow.com>.
I'm curious if anyone can shed some light on the relationship
between the ServletContext object and the PageContext object.
My issue is that I have a servlet form handler, and I want it to
be able to send some error information to a jsp page after
processing the form. For testing, I want to construct an error
string in the servlet, place it in the context as an attribute, and
then have the jsp page display it. But the servlet can't get a
PageContext object (can it?), so I figured I would do:

ServletContext.setAttribute("error", (Object)new String("Testing"));

Could the jsp page then do:

pageContext.getAttribute("error")

and find the attribute? If ServletContext() sets the attribute,
would it be page scope only? Can the servlet actually get a
PageContext object to use instead?

Thanks for any help and ideas.



________________________________________
  Mason Jones              mason(at)clipshow.com
  Director of Software Development
  ClipShow, Inc.            www.clipshow.com
  (650) 696-3164           fax (650) 696-3267


Re: Servlet reloading once more

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Matthew Lyons wrote:

> > Set reloadable to true for that context in the server.xml file
>
> It looks like he has already done this.
>
> > >         <Context path="/sis" docBase="webapps/sis" debug="0"
> > > reloadable="true" >
>
> So have I and I can't get the classes to autoreload either. Is it something
> to do with the way TomCat is started? In my case JBuilder is starting
> TomCat. It includes the project classes in the classpath. Does TomCat
> autoreload classes in the classpath?
>

No.  Auto-reloading (to the extent that it works -- there are bugs if
you have
more than one servlet running) can only reload classes that it loaded
from
WEB-INF/classes or WEB-INF/lib/*.jar in your web application.  You will
need to
make sure that JBuilder stores the servlet classes in one of these
places.

Craig McClanahan

RE: Servlet reloading once more

Posted by "Rob S." <rs...@home.com>.
> TomCat. It includes the project classes in the classpath. Does TomCat
> autoreload classes in the classpath?

I believe TC only reloads classes the context "knows" about via WEB-INF (lib
and classes in that context only).

- r


Re: Servlet reloading once more

Posted by Matthew Lyons <ma...@trifast-systems.co.uk>.
> Set reloadable to true for that context in the server.xml file

It looks like he has already done this.

> >         <Context path="/sis" docBase="webapps/sis" debug="0"
> > reloadable="true" >

So have I and I can't get the classes to autoreload either. Is it something
to do with the way TomCat is started? In my case JBuilder is starting
TomCat. It includes the project classes in the classpath. Does TomCat
autoreload classes in the classpath?

Below is output from JBuilder starting TomCat:

C:\JBuilder35\jdk1.2.2\bin\javaw  -classpath
"C:\JBuilder35\projects\menu\classes;D:\jakarta-tomcat\lib\jasper.jar;D:\jak
arta-tomcat\lib\servlet.jar;D:\jakarta-tomcat\lib\xml.jar;D:\jakarta-tomcat\
lib\webserver.jar;D:\Java Libs\jndi\lib\jndi.jar;D:\Java
Libs\jndi\ldap\lib\ldap.jar;D:\Java
Libs\jndi\ldap\lib\providerutil.jar;C:\JBuilder35\jdk1.2.2\jre\lib\rt.jar;C:
\JBuilder35\jdk1.2.2\jre\lib\i18n.jar;C:\JBuilder35\jdk1.2.2\lib\dt.jar;C:\J
Builder35\jdk1.2.2\lib\tools.jar;C:\JBuilder35\jdk1.2.2\lib\jpda.jar;C:\JBui
lder35\jdk1.2.2\jre\lib\ext\iiimp.jar"  -Duser.dir=C:\JBuilder35\projects\me
nu  -Dtomcat.home=D:/jakarta-tomcat org.apache.tomcat.startup.Tomcat
Context log: path="/examples" Adding context path="/examples"
docBase="webapps/examples"
Context log: path="" Adding context path=""  docBase="webapps/ROOT"
Context log: path="/test" Adding context path="/test"
docBase="webapps/test"
Set debug to 1

Context log: path="/menu" Adding context path="/menu"
docBase="webapps/menu"
Starting tomcat. Check logs/tomcat.log for error messages

Starting tomcat install="D:/jakarta-tomcat" home="D:\jakarta-tomcat"
classPath="C:\JBuilder35\projects\menu\classes;D:\jakarta-tomcat\lib\jasper.
jar;D:\jakarta-tomcat\lib\servlet.jar;D:\jakarta-tomcat\lib\xml.jar;D:\jakar
ta-tomcat\lib\webserver.jar;D:\Java Libs\jndi\lib\jndi.jar;D:\Java
Libs\jndi\ldap\lib\ldap.jar;D:\Java
Libs\jndi\ldap\lib\providerutil.jar;C:\JBuilder35\jdk1.2.2\jre\lib\rt.jar;C:
\JBuilder35\jdk1.2.2\jre\lib\i18n.jar;C:\JBuilder35\jdk1.2.2\lib\dt.jar;C:\J
Builder35\jdk1.2.2\lib\tools.jar;C:\JBuilder35\jdk1.2.2\lib\jpda.jar;C:\JBui
lder35\jdk1.2.2\jre\lib\ext\iiimp.jar"
Context log: path="/admin" Automatic context load
docBase="D:\jakarta-tomcat\webapps\admin"
Context log: path="/admin" Adding context path="/admin"
docBase="D:\jakarta-tomcat\webapps\admin"

Any ideas appreciated.

Regards
Matt

---
Matt Lyons
Trifast Systems Ltd
----- Original Message -----
From: Toby Piper <tp...@CompCraft.com>
To: <to...@jakarta.apache.org>
Sent: Thursday, July 13, 2000 4:41 PM
Subject: Servlet reloading once more


> Set reloadable to true for that context in the server.xml file.
>
> > -----Original Message-----
> > From: Svein Petter Larsen [mailto:spla@scandpower.no]
> > Sent: Thursday, July 13, 2000 5:40 AM
> > To: tomcat-user@jakarta.apache.org
> > Subject: Servlet reloading once more
> >
> >
> > Trying again
> >
> > This is eating up a lot of my time so I try to ask once more..
> >
> >  How can I set up Tomcat 3.1 to autoreload servlets?
> >  Every time I compile my servlet I have to stop and restart my Tomcat
> > to get the
> >  new class up and running.
> >  I have tried to put in the string in the file "server.xml" which says:
> >    <Context path="/sis" docBase="webapps/sis" debug="0"
reloadable="true" >
> >          </Context>
> >  where sis is my app. and it is under $TOMCAT_HOME/webapps/sis
> >  It did not work...
> >
> >
> >  It is timeconsuming to stop and start Tomcat on every compile
>
> >
> >  Is there an solutions?
> >
> >
> > ----------------------------------------------------------------------
> > --------------------
> > My web.xml under $TOMCAT_HOME/webapps/sis file look like:
> >
> > <?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>
> >
> >         <display-name>Subject Information System</display-name>
> >         <description>
> >         this is version 1.0 of SIS
> >         </description>
> >
> >         <context-param>
> >         <param-name>webmaster</param-name>
> >         <param-value>spla@scandpower.no</param-value>
> >         <description>
> >         The EMAIL address of the administrator to whom questions
> >         and comments about this application should be addressed.
> >         </description>
> >         </context-param>
> >
> > <!-- Define the default session timeout for your application,
> >          in minutes.  From a servlet or JSP page, you can modify
> >          the timeout for a particular session dynamically by using
> >          HttpSession.getMaxInactiveInterval(). -->
> >
> >         <session-config>
> >           <session-timeout>30</session-timeout>    <!-- 30 minutes -->
> >         </session-config>
> > </web-app>
> >
> > ----------------------------------------------------------------------
> > ----------------------
> >
> > My server.xml file under $TOMCAT_HOME/conf look like:
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> >
> > <Server>
> >     <!-- Debug low-level events in XmlMapper startup -->
> >     <xmlmapper:debug level="0" />
> >
> >     <!-- This is quite flexible; we can either have a log file per
> >          module in Tomcat (example: ContextManager) or we can have
> >          one for Servlets and one for Jasper, or we can just have
> >          one tomcat.log for both Servlet and Jasper.
> >
> >          If you omit "path" there, then stderr should be used.
> >
> >          verbosityLevel values can be:
> >             FATAL
> >             ERROR
> >             WARNING
> >             INFORMATION
> >             DEBUG
> >          -->
> >
> >     <Logger name="tc_log"
> >             path="logs/tomcat.log"
> >             customOutput="yes" />
> >
> >     <Logger name="servlet_log"
> >             path="logs/servlet.log"
> >             customOutput="yes" />
> >
> >     <Logger name="JASPER_LOG"
> >             path="logs/jasper.log"
> >             verbosityLevel = "INFORMATION" />
> >
> >     <!-- Add "home" attribute if you want tomcat to be based on a
> > different directory
> >          "home" is used to create work and to read webapps, but not
> > for libs or CLASSPATH.
> >          Note that TOMCAT_HOME is where tomcat is installed, while
> > ContextManager home is the
> >          base directory for contexts, webapps/ and work/
> >       -->
> >     <ContextManager debug="0" workDir="work" >
> >         <!-- ContextInterceptor
> > className="org.apache.tomcat.context.LogEvents" / -->
> >         <ContextInterceptor
className="org.apache.tomcat.context.AutoSetup" />
> >         <ContextInterceptor
> > className="org.apache.tomcat.context.DefaultCMSetter" />
> >         <ContextInterceptor
> > className="org.apache.tomcat.context.WorkDirInterceptor" />
> >         <ContextInterceptor
> > className="org.apache.tomcat.context.WebXmlReader" />
> >         <ContextInterceptor
> > className="org.apache.tomcat.context.LoadOnStartupInterceptor" />
> >         <!-- Request processing -->
> >         <RequestInterceptor
> > className="org.apache.tomcat.request.SimpleMapper" debug="0" />
> >         <RequestInterceptor
> > className="org.apache.tomcat.request.SessionInterceptor" />
> >         <RequestInterceptor
> > className="org.apache.tomcat.request.SecurityCheck" />
> >         <RequestInterceptor
> > className="org.apache.tomcat.request.FixHeaders" />
> >
> >        <!--
> >          <Connector
className="org.apache.tomcat.service.SimpleTcpConnector">
> >             <Parameter name="handler"
> > value="org.apache.tomcat.service.http.HttpConnectionHandler"/>
> >             <Parameter name="port" value="8080"/>
> >         </Connector>
> >         -->
> >
> >         <Connector
className="org.apache.tomcat.service.SimpleTcpConnector">
> >             <Parameter name="handler"
> > value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/>
> >
> >             <Parameter name="port" value="8007"/>
> >         </Connector>
> >
> >
> >         <!-- example - how to override AutoSetup actions -->
> >         <Context path="/examples" docBase="webapps/examples"
> > debug="0" reloadable="true" >
> >         </Context>
> >         <!-- example - how to override AutoSetup actions -->
> >         <Context path="" docBase="webapps/ROOT" debug="0"
reloadable="true" >
> >         </Context>
> >
> >     <Context path="/test" docBase="webapps/test" debug="0"
reloadable="true">
> >          </Context>
> >
> >         <Context path="/sis" docBase="webapps/sis" debug="0"
> > reloadable="true" >
> >         </Context>
> >
> >     </ContextManager>
> > </Server>
> >
> > --
> >
> > ================,,,=========================
> > ===============(o o)========================
> > ===========oOO==(_)==OOo====================
> >
> > Petter Larsen
> > Institutt for informatikk,
> > Universitetet i Oslo
> >
> > sveinpe@ifi.uio.no
> > http://www.stud.ifi.uio.no/~sveinpe
> >
> > Linux is best..:-)
> >
> > ===========ooooO==Ooooo=====================
> > ===========(   )==(   )=====================
> > ============\ (====) /======================
> > =============\_)==(_/=======================
> >
>


Servlet reloading once more

Posted by Toby Piper <tp...@CompCraft.com>.
Set reloadable to true for that context in the server.xml file.

> -----Original Message-----
> From: Svein Petter Larsen [mailto:spla@scandpower.no]
> Sent: Thursday, July 13, 2000 5:40 AM
> To: tomcat-user@jakarta.apache.org
> Subject: Servlet reloading once more
>
>
> Trying again
>
> This is eating up a lot of my time so I try to ask once more..
>
>  How can I set up Tomcat 3.1 to autoreload servlets?
>  Every time I compile my servlet I have to stop and restart my Tomcat
> to get the
>  new class up and running.
>  I have tried to put in the string in the file "server.xml" which says:
>    	<Context path="/sis" docBase="webapps/sis" debug="0" reloadable="true" >
>          	</Context>
>  where sis is my app. and it is under $TOMCAT_HOME/webapps/sis
>  It did not work...
>
>
>  It is timeconsuming to stop and start Tomcat on every compile

>
>  Is there an solutions?
>
>
> ----------------------------------------------------------------------
> --------------------
> My web.xml under $TOMCAT_HOME/webapps/sis file look like:
>
> <?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>
>
>         <display-name>Subject Information System</display-name>
>         <description>
>         this is version 1.0 of SIS
>         </description>
>
>         <context-param>
>         <param-name>webmaster</param-name>
>         <param-value>spla@scandpower.no</param-value>
>         <description>
>         The EMAIL address of the administrator to whom questions
>         and comments about this application should be addressed.
>         </description>
>         </context-param>
>
> <!-- Define the default session timeout for your application,
>          in minutes.  From a servlet or JSP page, you can modify
>          the timeout for a particular session dynamically by using
>          HttpSession.getMaxInactiveInterval(). -->
>
>         <session-config>
>           <session-timeout>30</session-timeout>    <!-- 30 minutes -->
>         </session-config>
> </web-app>
>
> ----------------------------------------------------------------------
> ----------------------
>
> My server.xml file under $TOMCAT_HOME/conf look like:
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <Server>
>     <!-- Debug low-level events in XmlMapper startup -->
>     <xmlmapper:debug level="0" />
>
>     <!-- This is quite flexible; we can either have a log file per
>          module in Tomcat (example: ContextManager) or we can have
>          one for Servlets and one for Jasper, or we can just have
>          one tomcat.log for both Servlet and Jasper.
>
>          If you omit "path" there, then stderr should be used.
>
>          verbosityLevel values can be:
>             FATAL
>             ERROR
>             WARNING
>             INFORMATION
>             DEBUG
>          -->
>
>     <Logger name="tc_log"
>             path="logs/tomcat.log"
>             customOutput="yes" />
>
>     <Logger name="servlet_log"
>             path="logs/servlet.log"
>             customOutput="yes" />
>
>     <Logger name="JASPER_LOG"
>             path="logs/jasper.log"
>             verbosityLevel = "INFORMATION" />
>
>     <!-- Add "home" attribute if you want tomcat to be based on a
> different directory
>          "home" is used to create work and to read webapps, but not
> for libs or CLASSPATH.
>          Note that TOMCAT_HOME is where tomcat is installed, while
> ContextManager home is the
>          base directory for contexts, webapps/ and work/
>       -->
>     <ContextManager debug="0" workDir="work" >
>         <!-- ContextInterceptor
> className="org.apache.tomcat.context.LogEvents" / -->
>         <ContextInterceptor className="org.apache.tomcat.context.AutoSetup" />
>         <ContextInterceptor
> className="org.apache.tomcat.context.DefaultCMSetter" />
>         <ContextInterceptor
> className="org.apache.tomcat.context.WorkDirInterceptor" />
>         <ContextInterceptor
> className="org.apache.tomcat.context.WebXmlReader" />
>         <ContextInterceptor
> className="org.apache.tomcat.context.LoadOnStartupInterceptor" />
>         <!-- Request processing -->
>         <RequestInterceptor
> className="org.apache.tomcat.request.SimpleMapper" debug="0" />
>         <RequestInterceptor
> className="org.apache.tomcat.request.SessionInterceptor" />
>         <RequestInterceptor
> className="org.apache.tomcat.request.SecurityCheck" />
>         <RequestInterceptor
> className="org.apache.tomcat.request.FixHeaders" />
>
>        <!--
>          <Connector className="org.apache.tomcat.service.SimpleTcpConnector">
>             <Parameter name="handler"
> value="org.apache.tomcat.service.http.HttpConnectionHandler"/>
>             <Parameter name="port" value="8080"/>
>         </Connector>
>         -->
>
>         <Connector className="org.apache.tomcat.service.SimpleTcpConnector">
>             <Parameter name="handler"
> value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/>
>
>             <Parameter name="port" value="8007"/>
>         </Connector>
>
>
>         <!-- example - how to override AutoSetup actions -->
>         <Context path="/examples" docBase="webapps/examples"
> debug="0" reloadable="true" >
>         </Context>
>         <!-- example - how to override AutoSetup actions -->
>         <Context path="" docBase="webapps/ROOT" debug="0" reloadable="true" >
>         </Context>
>
>     <Context path="/test" docBase="webapps/test" debug="0" reloadable="true">
>          </Context>
>
>         <Context path="/sis" docBase="webapps/sis" debug="0"
> reloadable="true" >
>         </Context>
>
>     </ContextManager>
> </Server>
>
> --
>
> ================,,,=========================
> ===============(o o)========================
> ===========oOO==(_)==OOo====================
>
> Petter Larsen
> Institutt for informatikk,
> Universitetet i Oslo
>
> sveinpe@ifi.uio.no
> http://www.stud.ifi.uio.no/~sveinpe
>
> Linux is best..:-)
>
> ===========ooooO==Ooooo=====================
> ===========(   )==(   )=====================
> ============\ (====) /======================
> =============\_)==(_/=======================
>