2011/08/15 - Apache Xindice has been retired.

For more information, please explore the Attic.

apache > xml.apache > xindice
 

Xindice Tomcat How-To

Intended audience

This How-to is aimed at developers or administrators who want to install Xindice with Tomcat.

Prerequisites

The most important prerequisite is patience. Take lots of deep breaths. It will work. It just might take some time.

  • You should have already compiled Xindice.
  • You must have an existing installation of Tomcat. You should use version 4.1.12 or higher. You can download Tomcat from the Jakarta website.
  • Be sure to set the CATALINA_HOME environmental variable to point to the location of your Tomcat installation.

Steps

Copy the WAR file

If you've followed the prerequisites, then you will have a working version of Tomcat installed, and the sources of Xindice compiled. Now, copy the xindice-*.war file from dist to the %CATALINA_HOME%/webapps.

Warning
It is important to rename the file while copying to the xindice.war, as name of the file defines context name, and Xindice clients and tools use xindice context name by default.

Here's what that looks like in Windows:

D:\xindice\current\xml-xindice>dir dist
 Volume in drive D is Data
 Volume Serial Number is A3EB-9689

 Directory of D:\xindice\current\xml-xindice\dist

01/01/2004  03:34 PM    <DIR>          .
01/01/2004  03:34 PM    <DIR>          ..
01/01/2004  03:34 PM           464,594 xindice-1.1b3.jar
01/01/2004  03:35 PM         4,313,587 xindice-1.1b3.war
01/01/2004  03:34 PM               253 xindice-1.1b3.xml
               3 File(s)      4,778,434 bytes
               2 Dir(s)  42,307,837,952 bytes free

D:\xindice\current\xml-xindice>copy dist\xindice-1.1b3.war %CATALINA_HOME%\webapp
s\xindice.war
        1 file(s) copied.

D:\xindice\current\xml-xindice>
      
Note
In this example, I have built Xindice in D:\xindice\current. If you compile the source in another location, just substitute that path for D:\xindice\current.

 

If you are using Linux, your session might resemble:

root@gogo:/local/xml-xindice# ls -oa dist
total 4668
drwxr-xr-x    2 root         4096 Nov 25 20:10 .
drwxr-xr-x   13 root         4096 Nov 25 00:01 ..
-rw-r--r--    1 root       464594 Jan  1 15:34 xindice-1.1b3.jar
-rw-r--r--    1 root      4313587 Jan  1 15:35 xindice-1.1b3.war
-rw-r--r--    1 root          253 Jan  1 15:34 xindice-1.1b3.xml
root@gogo:/local/xml-xindice# cp dist/xindice-1.1b3.war $CATALINA_HOME/webapps/xindice.war
root@gogo:/local/xml-xindice# 
      
Note
In this Linux session, the Xindice root directory is in /local/xml-xindice. You should substitute your actual XINDICE_HOME path for /local/xml-xindice.

Edit the Tomcat's server.xml File (Optional)

Tomcat will automatically deploy copied war file with the default settings. To modify those defaults, CATALINA_HOME/conf/server.xml file should be edited. Suggested changes for the server.xml file are contained in the XINDICE_HOME/dist/xindice-1.1b3.xml file.

Restart Tomcat

Restart your Tomcat server to be certain that it picks up the Xindice servlet. This step is required if you have edited CATALINA_HOME/conf/server.xml file. In other cases, it is usually not required.

Here's what that looks like in Windows

D:\xindice\current\xml-xindice>cd %CATALINA_HOME%\bin

D:\jakarta-tomcat-4.1.12\bin>startup
Using CATALINA_BASE:   D:\jakarta-tomcat-4.1.12
Using CATALINA_HOME:   D:\jakarta-tomcat-4.1.12
Using CATALINA_TMPDIR: D:\jakarta-tomcat-4.1.12\temp
Using JAVA_HOME:       C:\j2sdk1.4.1_01
D:\jakarta-tomcat-4.1.12\bin>
      
Note
In this example, I have installed Tomcat in D:\jakarta-tomcat-4.1.12. If you've installed it in another location, just ensure that the CATALINA_HOME environmental variable points to your Tomcat installation directory, or substitute that path for D:\jakarta-tomcat-4.1.12.

 

Here's what that might look like on Linux

root@gogo:/var/tomcat4/bin# ./catalina.sh start
Using CATALINA_BASE:   /var/tomcat4
Using CATALINA_HOME:   /var/tomcat4
Using CATALINA_TMPDIR: /var/tomcat4/temp
Using JAVA_HOME:       /usr/java/jdk1.3.1_06
root@gogo:/var/tomcat4/bin#
      
Note
The name of the Tomcat installation directory may differ for your Linux platform. The default location is /var/tomcat4. If you are unsure of the location, check the tomcat4.conf file in your /etc/tomcat4 directory.

 

Warning
If you installed the RPM version of Tomcat v4.x, you may need to enter "tomcat4 start" to invoke the Tomcat server. The FreeBSD version of Tomcat may be using tomcat41ctl.

 

Verify the installation

When Tomcat restarts on Windows, you should see a new window open entitled 'Tomcat', and it should look something like this. (Note the xindice classes loading.)

Nov 21, 2002 1:42:07 PM org.apache.commons.modeler.Registry loadRegistry
INFO: Loading registry information
Nov 21, 2002 1:42:07 PM org.apache.commons.modeler.Registry getRegistry
INFO: Creating new Registry instance
Nov 21, 2002 1:42:08 PM org.apache.commons.modeler.Registry getServer
INFO: Creating MBeanServer
Nov 21, 2002 1:42:09 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on port 8080
Starting service Tomcat-Standalone 
Apache Tomcat/4.1.12
Nov 21, 2002 1:42:21 PM org.apache.xindice.core.Database setConfig
INFO: Database points to D:\jakarta-tomcat-4.1.12\bin\.\db
Nov 21, 2002 1:42:23 PM org.apache.xindice.server.XindiceServlet init
INFO: Database successfully started
Nov 21, 2002 1:42:24 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on port 8080
Nov 21, 2002 1:42:24 PM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on tcp port 8009
Nov 21, 2002 1:42:24 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=20/70  config=D:\jakarta-tomcat-4.1.12\conf\jk2.properties
      

 

Here's what the $CATALINA_HOME/logs/catalina.out output looks like on Linux

[INFO] Registry - -Loading registry information
[INFO] Registry - -Creating new Registry instance
[INFO] Registry - -Creating MBeanServer
[INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080
Starting service Tomcat-Standalone
Apache Tomcat/4.1
Server 1.6 is running
Press [Ctrl]+[C] to abort
[INFO] Http11Protocol - -Starting Coyote HTTP/1.1 on port 8080
[INFO] ChannelSocket - -JK2: ajp13 listening on tcp port 8009
[INFO] JkMain - -Jk running ID=0 time=4/168  
config=/var/tomcat4/conf/jk2.properties
      

In addition, you should be able to verify that xindice is running by loading this URL in your browser http://localhost:8080/xindice. If it works, you should see something that says "THIS IS AN UGLY DEBUG TOOL!".

If you run into problems, don't worry. Be sure to send feedback so that we can improve these documents for the next person.

Revisions

Find a problem with this document? Consider contacting the mailing lists or submitting your own revision. For instructions, read the How To Submit a Revision.

by Dave Viner, Vadim Gritsenko

version 511427