Gianugo,
Do you have a quicky howto, etc. to get Xindice
running under Jetty? I haven't looked at it yet,
but I would like to start doing most of my dev
testing under Jetty instead of Tomcat.
A piece of cake. :-) Just create a /tools/jetty directory, and copy there the Jetty directory structure files from, say, Cocoon or Forrest, i.e:
$ ls -lR xml-xindice/tools/jetty/ xml-xindice/tools/jetty/: totale 4 drwxrwxrwx 2 Administ Nessuno 0 Dec 27 09:29 conf drwxrwxrwx 2 Administ Nessuno 4096 Dec 9 16:03 lib
xml-xindice/tools/jetty/conf: totale 4 -rwxrwxrwx 1 Administ Nessuno 3224 Dec 13 16:33 jettyconf.xml
xml-xindice/tools/jetty/lib:
totale 873
-rwxrwxrwx 1 Administ Nessuno 74487 Dec 3 01:10 javax.servlet.jar
-rwxrwxrwx 1 Administ Nessuno 249707 Dec 3 01:10 org.apache.jasper.jar
-rwxrwxrwx 1 Administ Nessuno 529324 Dec 3 01:10 org.mortbay.jetty-jdk1.2
.jar
-rwxrwxrwx 1 Administ Nessuno 39526 Dec 3 01:10 org.mortbay.jmx.jar
Copy under /tools/jetty/jettyconf.xml the attached file, and use the "run" target from the jetty.xml attached build file. You should be up and running out of the box, no more deploying needed. :-)
LMK if you need more help,
-- Gianugo
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure 1.2//EN" "http://jetty.mortbay.org/configure_1_2.dtd">
<!-- =============================================================== --> <!-- Configure the Jetty Server --> <!-- =============================================================== --> <Configure class="org.mortbay.jetty.Server"> <!-- =============================================================== --> <!-- Configure the Request Listeners --> <!-- =============================================================== --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- Add and configure a HTTP listener to port 8080 --> <!-- The default port can be changed using: java -Djetty.port=80 --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <Call name="addListener"> <Arg> <New class="org.mortbay.http.SocketListener"> <Set name="Port"><SystemProperty name="jetty.port" default="8888"/></Set> <Set name="MinThreads">5</Set> <Set name="MaxThreads">100</Set> <Set name="MaxIdleTimeMs">30000</Set> <Set name="LowResourcePersistTimeMs">5000</Set> </New> </Arg> </Call> <!-- <Set name="Debug" class="org.mortbay.util.Code" type="boolean">true</Set> <Set name="Verbose" class="org.mortbay.util.Code" type="int">99</Set> <Set name="DebugPatterns" class="org.mortbay.util.Code" type="String">"SocketListener,ThreadedServer"</Set> <Call name="instance" class="org.mortbay.util.Log"> <Call name="disableLog"/> <Call name="add"> <Arg> <New class="org.mortbay.util.WriterLogSink"> <Arg><SystemProperty name="jetty.home" default="."/>/logs/debug_yyyy_mm_dd.log</Arg> <Set name="RetainDays">90</Set> <Set name="Append">true</Set> <Call name="start"/> </New> </Arg> </Call> </Call> --> <!-- =============================================================== --> <!-- Configure the Contexts --> <!-- =============================================================== --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- Add root context web applications. --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- Add a all web application within the webapps directory. --> <!-- + No virtual host specified --> <!-- + Look in the webapps directory relative to jetty.home or . --> <!-- + Use the webdefault.xml resource for the defaults descriptor --> <!-- + Upack the war file --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <Call name="addWebApplication"> <Arg>/Xindice</Arg> <Arg><SystemProperty name="jetty.home" default="."/>/xindice-1.1b.war</Arg> </Call> </Configure>
<?xml version="1.0"?> <!-- - Build file for the Xindice Project. - - This script should be started with the following command line : - - ant <target> - - Or if Jakarta Ant is not installed on your system: - - cd xml-xindice; bin/ant - - Jakarta Ant can be downloaded from <http://jakarta.apache.org/ant> - - Run "ant -projecthelp" to get a list of available targets. - - Version: $Revision: 1.35 $ $Date: 2002/11/28 22:31:04 $ - Authors: Tom Bradford ([EMAIL PROTECTED]) - Kimbro Staken ([EMAIL PROTECTED]) - Fernando Padrilla ([EMAIL PROTECTED]) - James Bates ([EMAIL PROTECTED]) - Vladimir R. Bossicard ([EMAIL PROTECTED]) --> <project name="xml-xindice" default="release" basedir="."> <!-- - Give the chance to overwrite the definitions by setting the - build.properties file. --> <property file="build.properties"/> <property environment="ENVIRONMENT"/> <!-- =================================================================== --> <!-- Build definitions --> <!-- =================================================================== --> <!-- Project's properties --> <property name="project.name" value="xml-xindice"/> <property name="project.filename" value="xindice"/> <property name="project.version" value="1.1b"/> <property name="project.year" value="1999-2002"/> <property name="webapp.name" value="Xindice"/> <!-- source directories --> <property name="root.dir" value="java"/> <property name="jar.dir" value="${root.dir}/lib"/> <property name="src.dir" value="${root.dir}/src"/> <property name="config.dir" value="config"/> <property name="test.src.dir" value="${root.dir}/tests/src"/> <!-- destination directories --> <property name="build.dir" value="build"/> <property name="src.build.dir" value="${build.dir}/classes"/> <property name="test.build.dir" value="${build.dir}/classes-tests"/> <property name="api.dir" value="${build.dir}/api"/> <property name="dist.dir" value="dist"/> <property name="javadoc.pkgs" value="org.apache.xindice.*"/> <!-- External projects properties --> <property name="tomcat.home" value="${ENVIRONMENT.TOMCAT_HOME}" /> <!-- Compilation properties --> <property name="compile.debug" value="on"/> <property name="compile.optimize" value="off"/> <property name="compile.nowarn" value="off"/> <property name="compile.deprecation" value="on"/> <property name="compile.verbose" value="off"/> <!-- classpath to use within project --> <path id="project.class.path"> <!-- compiled classes directory --> <pathelement location="${src.build.dir}"/> <!-- all jars in jar directory --> <fileset dir="${jar.dir}"> <include name="*.jar"/> <exclude name="xerces-2.2.1.jar xml-apis-2.2.1.jar xml-xupdate-0.3.jar"/> </fileset> </path> <target name="init" description="Initializes the build"> <tstamp/> <mkdir dir="${src.build.dir}"/> <mkdir dir="${test.build.dir}"/> <mkdir dir="${api.dir}"/> <mkdir dir="${dist.dir}"/> </target> <!-- =================================================================== --> <!-- Definition of the main targets --> <!-- =================================================================== --> <target name="build" depends="init, src-build, test-build" description="Compiles the source and test code"> <ant antfile="build.xml" dir="java/examples" inheritAll="false" target="build"/> </target> <target name="release" depends="jar-release, war-release" description="Generates the jar and war releases into the dist directory"> <ant antfile="build.xml" dir="java/examples" inheritAll="false" target="release"/> </target> <target name="clean" description="Removes all generates files"> <delete dir="${build.dir}"/> <delete dir="${dist.dir}"/> <ant antfile="build.xml" dir="java/examples" inheritAll="false" target="clean"/> </target> <!-- =================================================================== --> <!-- Compiles the source code --> <!-- =================================================================== --> <target name="src-build" depends="init"> <javac srcdir="${src.dir}" destdir="${src.build.dir}" debug="${compile.debug}" optimize="${compile.optimize}" nowarn="${compile.nowarn}" deprecation="${compile.deprecation}" verbose="${compile.verbose}"> <classpath> <path refid="project.class.path"/> </classpath> </javac> </target> <target name="src-clean"> <delete dir="${src.build.dir}"/> <antcall target="test-clean"/> </target> <!-- =================================================================== --> <!-- Compiles and executes the tests --> <!-- =================================================================== --> <target name="test-build" depends="src-build"> <javac srcdir="${test.src.dir}" destdir="${test.build.dir}" debug="${compile.debug}" optimize="${compile.optimize}" nowarn="${compile.nowarn}" deprecation="${compile.deprecation}" verbose="${compile.verbose}"> <classpath> <path refid="project.class.path"/> </classpath> </javac> </target> <target name="test-unit" depends="test-build"> <junit fork="yes" printsummary="yes" haltonfailure="no"> <jvmarg value="-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog" /> <jvmarg value="-Dorg.apache.commons.logging.simplelog.defaultlog=debug" /> <test name="org.apache.xindice.UnitTests" /> <formatter type="plain" usefile="no" /> <classpath> <path refid="project.class.path"/> <pathelement location="${test.build.dir}"/> </classpath> </junit> </target> <target name="test-integration-embed" depends="test-build"> <junit fork="yes" printsummary="yes" haltonfailure="no"> <jvmarg value="-Dxindice.home=${basedir}" /> <jvmarg value="-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog" /> <jvmarg value="-Dorg.apache.commons.logging.simplelog.defaultlog=debug" /> <test name="org.apache.xindice.IntegrationEmbedTests" /> <formatter type="plain" usefile="no" /> <classpath> <path refid="project.class.path"/> <pathelement location="${test.build.dir}"/> </classpath> </junit> </target> <target name="test-integration-xmlrpc" depends="test-build"> <junit fork="yes" printsummary="yes" haltonfailure="no"> <jvmarg value="-Dxindice.home=${basedir}" /> <jvmarg value="-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog" /> <jvmarg value="-Dorg.apache.commons.logging.simplelog.defaultlog=debug" /> <test name="org.apache.xindice.IntegrationXmlRpcTests" /> <formatter type="plain" usefile="no" /> <classpath> <path refid="project.class.path"/> <pathelement location="${test.build.dir}"/> </classpath> </junit> </target> <target name="test-clean"> <delete dir="${test.build.dir}"/> </target> <!-- =================================================================== --> <!-- Build the Xindice archives (jar and war) --> <!-- =================================================================== --> <target name="jar-release" depends="src-build, test-build"> <jar jarfile="${dist.dir}/${project.filename}-${project.version}.jar" basedir="${src.build.dir}"> <manifest> <attribute name="Built-By" value="${user.name}"/> <section name="org/apache/xindice"> <attribute name="Sealed" value="false"/> </section> </manifest> </jar> </target> <target name="jar-clean"> <delete file="${dist.dir}/${project.filename}-${project.version}.jar" /> </target> <target name="war-release" depends="jar-release"> <copy file="${config.dir}/xindice.xml" toFile="${dist.dir}/xindice-${project.version}.xml"> <filterset> <filter token="VERSION" value="${project.version}"/> </filterset> </copy> <war destfile="${dist.dir}/${project.filename}-${project.version}.war" update="false" webxml="config/web.xml"> <classes dir="${src.build.dir}"/> <webinf dir="config"> <include name="system.xml"/> </webinf> <!-- <webinf dir="."> <include name="config/*.*"/> </webinf> <webinf dir="bin"> <include name="xindicewar"/> <include name="xindicewar.bat"/> </webinf> --> <lib dir="${jar.dir}"> <include name="commons-logging-1.0.1.jar" /> <include name="xmldb-api-20021118.jar"/> <include name="xmldb-api-sdk-20021118.jar"/> <include name="xmldb-xupdate.jar"/> <include name="infozone-tools.jar"/> <include name="xalan-2.4.0.jar"/> <include name="xercesImpl-2.1.0.jar"/> <include name="xmlrpc-1.1.jar"/> <include name="xml-apis-1.0b3.jar"/> </lib> <manifest> <attribute name="Built-By" value="${user.name}"/> <section name="org/apache/xindice"> <attribute name="Sealed" value="false"/> </section> </manifest> </war> </target> <target name="war-clean"> <delete file="${dist.dir}/${project.filename}-${project.version}.war" /> <delete file="${dist.dir}/${project.filename}-${project.version}.xml" /> </target> <target name="tomcat-deploy" depends="war-release" description="Deployes the Xindice webapp into the Tomcat installation"> <copy file="${dist.dir}/${project.filename}-${project.version}.xml" todir="${tomcat.home}/webapps"/> <copy file="${dist.dir}/${project.filename}-${project.version}.war" todir="${tomcat.home}/webapps"/> <!-- todo currently try to test the use of the xindice-1.1b.xml file for the Tomcat installation. <unjar src="${dist.dir}/${project.filename}-${project.version}.war" dest="${tomcat.home}/webapps/${webapp.name}" overwrite="true"/> --> </target> <target name="tomcat-clean" description="Removes the deployed Xindice webapp from the Tomcat installation"> <delete dir="${tomcat.home}/webapps/${webapp.name}"/> <delete file="${tomcat.home}/webapps/${project.filename}-${project.version}.xml"/> </target> <!-- =================================================================== --> <!-- Documentation Build Targets --> <!-- =================================================================== --> <target name="javadoc" depends="init"> <delete dir="${api.dir}"/> <mkdir dir="${api.dir}"/> <javadoc packagenames="org.apache.xindice.*" destdir="${api.dir}" overview="${src.dir}/overview.html" author="true" version="true" protected="true" use="false" windowtitle="Xindice API v${project.version}" doctitle="Xindice API, version ${project.version}<br>API specification" header="<b>Xindice API<br>version ${project.version}</b>" bottom="Copyright (c) ${project.year} The Apache Software Foundation. All Rights Reserved."> <group title="Core packages" packages="org.apache.xindice.core*:org.apache.xindice.xml*:org.apache.xindice.util"/> <group title="Server packages" packages="org.apache.xindice.server*"/> <group title="Client packages" packages="org.apache.xindice.client*"/> <group title="Tools packages" packages="org.apache.xindice.tools*"/> <sourcepath> <pathelement location="${src.dir}" /> </sourcepath> <classpath> <pathelement location="${jar.dir}/ant-1.5.1.jar" /> <pathelement location="${jar.dir}/commons-logging-1.0.1.jar" /> <pathelement location="${jar.dir}/xmldb-api-20021118.jar"/> <pathelement location="${jar.dir}/xmldb-api-sdk-20021118.jar"/> <pathelement location="${jar.dir}/xmldb-xupdate.jar"/> <pathelement location="${jar.dir}/infozone-tools.jar"/> <pathelement location="${jar.dir}/xalan-2.4.0.jar"/> <pathelement location="${jar.dir}/servlet.jar"/> <pathelement location="${jar.dir}/xercesImpl-2.1.0.jar"/> <pathelement location="${jar.dir}/xmlrpc-1.1.jar"/> <pathelement location="${jar.dir}/xml-apis-1.0b3.jar"/> </classpath> </javadoc> </target> <target name="javadoc-clean"> <delete dir="${api.dir}"/> </target> <target name="gump-target" depends="release"/> <!-- =================================================================== --> <!-- LOCAL SERVER RUN ACTION --> <!-- =================================================================== --> <target name="run" depends="war-release" description="Run Jetty with configuration set by the jetty.run property"> <copy file="./tools/jetty/conf/jettyconf.xml" todir="./dist" filtering="on"/> <java classname="org.mortbay.jetty.Server" dir="./dist" fork="yes" failonerror="yes"> <classpath> <path refid="project.class.path" /> <fileset dir="./tools/jetty/lib"> <include name="*.jar"/> <include name="*.JAR"/> <include name="*.zip"/> <include name="*.ZIP"/> </fileset> </classpath> <!--<jvmarg value="-Djava.endorsed.dirs=${java.endorsed.dirs}${path.separator}${endorsed.dir}"/>--> <!-- <sysproperty key="DEBUG" value="yes"/> --> <sysproperty key="xindice.db.home" value="../db"/> <sysproperty key="jetty.home" value="."/> <sysproperty key="jetty.port" value="8080"/> <arg line="jettyconf.xml" /> </java> </target> </project> <!-- End of file -->