You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by David Meaker <Da...@angelshade.com> on 2001/04/30 12:12:28 UTC

Manually reloading classes without restarting catalina

I was getting very frustrated with tdk1.a13 not reloading classes when they
were recompiled. (even though I set a context with reloadable="true" in
server.xml)  I found the only way to do this was to restart catalina?  Here
is a manual workaround that has helped speed things up.  (This was found in
the Catalina docs.)

1. in the tdk/conf/tomcat_users.xml

	add the following user.  The role must be manager.
		<user name="manager" password="manag3r" roles="manager" />

2. create directory webapps/manager/WEB-INF 
3. create a file called web.xml in this directory

4. insert the following into 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/j2ee/dtds/web-app_2_3.dtd">

<web-app>

  <!-- Define the Manager Servlet -->
  <servlet>
    <servlet-name>Manager</servlet-name>
 
<servlet-class>org.apache.catalina.servlets.ManagerServlet</servlet-class>
    <init-param>
      <param-name>debug</param-name>
      <param-value>2</param-value>
    </init-param>
  </servlet>

  <!-- Define the Manager Servlet Mapping -->
  <servlet-mapping>
    <servlet-name>Manager</servlet-name>
    <url-pattern>/*</url-pattern>
  </servlet-mapping>

  <!-- Define a Security Constraint on this Application -->
  <security-constraint>
    <web-resource-collection>
      <web-resource-name>Entire Application</web-resource-name>
      <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
       <!-- NOTE:  This role is not present in the default users file -->
       <role-name>manager</role-name>
    </auth-constraint>
  </security-constraint>

  <!-- Define the Login Configuration for this Application -->
  <login-config>
    <auth-method>BASIC</auth-method>
    <realm-name>Tomcat Manager Application</realm-name>
  </login-config>

</web-app>

5. restart catalina.

6. enter the following url
	http://localhost:8080/manager/reload?path=/<appname>

7. sign on as manager / manag3r

8. Classes are reloaded.

9. Each time you hit the url it will reload the app quite quickly, works for
changes to the turbine.resources files.

Hope this helps

Dave

PS. Jason, perhaps we could include the manager app when building the next
TDK.

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org