TomcatAutoRegistration

Tomcat Auto-registration

This document describes Tomcat server instance auto-registration support in NetBeans. The most important client of this feature is the NetBeans installer.

Description

Tomcat instance auto-registration support is similar to the one that the JBoss and GlassFish plug-ins provide, it is, however, slightly enhanced in order to support also unregistration of a previously auto-registered server.

The auto-registration support may be used to register any of the following versions of Apache Tomcat 5.0.x, 5.5.x or 6.0.x.

Registration

In order to auto-register a Tomcat instance the server installation directory, also known as the Catalina Home directory, has to be passed via the org.netbeans.modules.tomcat.autoregister.catalinaHome system property along with a unique token* passed via the org.netbeans.modules.tomcat.autoregister.token system property to the NetBeans process.

 $NETBEANS_ROOT/bin/netbeans -J-Dorg.netbeans.modules.tomcat.autoregister.catalinaHome=/opt/apache-tomcat-6.0.10 
-J-Dorg.netbeans.modules.tomcat.autoregister.token=1173879696993 

* The token is used to identify the server instance when it was unregistered, see below. In the example above the token was generated by java.lang.System.currentTimeMillis().

When the IDE starts up and the two system properties are set, the plug-in recognizes the Tomcat server version and generates the Catalina Base folder location as $NETBEANS_USER_DIRECTORY/apache-tomcat-{$TOMCAT.VERSION}_base. If no server instance with the same Catalina Home and Catalina Base folders has been registered before, it is registered now and the following parameters are set by default.

  • display name* = Apache Tomcat $TOMCAT.VERSION
  • username = ide
  • password = auto-generated 8 chars long
  • HTTP port = 8084
  • shutdown port = 8025

* If the display name is already used by some other server instance a unique one is generated by suffixing (1), (2), etc.

Unregistration

There are two ways how a previously auto-registered Tomcat can be unregistered from the IDE.

  1. Unregistration from the running IDE. The server can be removed either from the Server Manager or from the Runtime Window. The Tomcat plug-in has to remember the token of the removed server instance so that the same instance is not registered again during the next IDE startup. If a new token is passed via the org.netbeans.modules.tomcat.autoregister.token system property, the server instance will be registered again.
  2. Unregistration outside the IDE by removing the org.netbeans.modules.tomcat.autoregister.catalinaHome and org.netbeans.modules.tomcat.autoregister.token system properties. When the IDE starts up and the two properties are not set the previously auto-registered Tomcat instance is removed.


Limitations

  • only one Tomcat server instance can be auto-registered via the org.netbeans.modules.tomcat.autoregister.catalinaHome system property.
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo