Xindice with Tomcat Top Tips
by Jim Fuller jim.fuller@ruminate.co.uk Jan 10th, 2004
Top tips when installing xindice v1.1b3 with Tomcat as war file
- Where to start ?
Read the current documentation ( not the 1.0 docs ) for installation, it is relatively clear.
First ensure that xindice is running properly by using the commandline tool to populate with example documents and generally verify operation.
- Where is xindice commandline ?
If you did not download via cvs or more specifically the xindice /src version you may just have a .war file. Where is the xindiceadmin or xindice commandline tool you ask ?
Well first off they have been rolled together into one tool named xindice, which if you have the right distribution will be contained in the /bin directory. The best coarse of action is to use cvs to get the most up to date version of xindice and use ant to build it. Remember to get old xindice off the classpath or and correctly define XINDICE_HOME environment variable to point to xindice distribution.
- XML-RPC is not accessible ?
Default port if you are accessing via Tomcat is 8080, if you have elected to run xindice in standalone mode with Jetty then its 8888.
Your web.xml should 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">
<!-- {{{ - Version: $Revision: 1.8 $ $Date: 2003/12/30 13:07:38 $
- Authors: Kimbro Staken (kstaken@xmldatabases.org) - Vladimir R. Bossicard (vladimir@bossicard.com) --> }}}
<web-app> {{{ <display-name>Apache Xindice</display-name>
<description>Apache Xindice XMLRPC Server</description> <servlet>
<servlet-name>xindice</servlet-name> <servlet-class>org.apache.xindice.server.XindiceServlet</servlet-class> <init-param>
<param-name>xindice.configuration</param-name> <param-value>/WEB-INF/system.xml</param-value>
</init-param> <load-on-startup>1</load-on-startup>
</servlet> <servlet-mapping>
<servlet-name>xindice</servlet-name> <url-pattern>/*</url-pattern>
</servlet-mapping> <servlet-mapping>
<servlet-name>xindice</servlet-name> <url-pattern>/</url-pattern>
</servlet-mapping> }}}
</web-app>
note the lowercase xindice ( instead of Xindice ), its important.
Otherwise are you addressing the database properly...dont just use /xindice for a path use /xindice/db.
- Some questions to ask if you are stuck
Is the port accesible ? Is there a firewall, iptables, ipchains or something blocking the default 8080 port ?
Does your Tomcat got BASIC authentication on for this application ? You will need to supply HTTP Authorization: Basic header if you do.
- What is metadata ?
It effectively allows you to have every xml document have a seperate xml document which contains meta data. Isn't xml meta data you ask ? Well sometimes its nice to have a clear seperation between the xml vocabulary and items that further describe the xml document as a whole.
Another good reason to use metadata documents is why spend the cycles transforming to and fro certain formats. I tend to place versioning and authoring information in my metadata, especially if I have xml coming from a variety of sources through automatic processes.
To turn on metadata storage in Xindice, edit the system.xml configuration file and set the use-metadata attribute of the root-collection element to on. Restart your container, and metadata storage will be enabled.
more to come....