XML Apache Xindice
 
   

Xindice Tomcat How-To

printer
print-friendly
version

by Dave Viner

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 install 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 %CATALINA_HOME%/webapps

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

11/18/2002  01:55p      <DIR>          .
11/18/2002  01:55p      <DIR>          ..
11/18/2002  01:55p               9,467 xindice-1.1b-examples.jar
11/20/2002  03:57p             392,842 xindice-1.1b.jar
11/20/2002  03:57p           2,421,719 xindice-1.1b.war
               3 File(s)      2,824,028 bytes
               2 Dir(s)   6,087,331,840 bytes free

D:\xindice\current\xml-xindice>copy dist\xindice-1.1b.war %CATALINA_HOME%\webapp
s\
        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 -oat dist
total 2760
drwxr-xr-x    2 root         4096 Nov 25 20:10 .
-rw-r--r--    1 root          247 Nov 25 20:10 xindice-1.1b.xml
drwxr-xr-x   13 root         4096 Nov 25 00:01 ..
-rw-r--r--    1 root         9504 Nov 23 15:27 xindice-1.1b-examples.jar
-rw-r--r--    1 root      2408531 Nov 23 15:27 xindice-1.1b.war
-rw-r--r--    1 root       379794 Nov 23 15:27 xindice-1.1b.jar
root@gogo:/local/xml-xindice# cp dist/xindice-1.1b.war $CATALINA_HOME/webapps
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 server.xml File

Fixme ( jcarroll )
Need section on inserting XINDICE_HOME/dist/xindice-1.1b.xml entry into the CATALINA_HOME/conf/server.xml file here.

Restart Tomcat

Restart your Tomcat server to be certain that it picks up the Xindice servlet.

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-1.1b 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 author or submitting your own revision. For instructions, read the How To Submit a Revision.