Changeset 10068


Ignore:
Timestamp:
2005-06-13T14:18:50+12:00 (19 years ago)
Author:
kjdon
Message:

added some notes for jni stuff with external tomcat

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/README.txt

    r9994 r10068  
    101101So should only use anonymous cvs.
    102102
     103Using External Tomcat:
     104------------------------
     105
     106If you want to use an existing Tomcat, set the path to its base directory
     107in build.properties. You will need to modify the Tomcat setup slightly.
     108
     1091. Add in the Greenstone context to Tomcat's server.xml.
     110
     111<Context path="/gsdl3" docBase="path-to-gsdl3/web" debug="1"
     112reloadable="true"><Resources allowLinking='true'/></Context>
     113
     114Alternatively, you can rename the gsdl3/web directory to gsdl3 and move it into
     115Tomcat's webapps directory. (i.e. the resulting directories will be like
     116webapps/gsdl3/WEB-INF, no web directory).
     117TODO: check that this works.
     118You will need to set the web.home property in the build.properties file
     119eg
     120web.home=path-to-tomcat/webapps/gsdl3
     121
     1222. Set up the JNI libraries and Java wrappers.
     123JNI libraries and their Java wrappers cannot go into the web app. The libraries need to be loaded by the same class loader as their wrappers. The libraries need to be in java.library.path, and I think get loaded by the system class loader.
     124The wrappers need to be loaded by this too.
     125To get the native libraries loaded, the directory they are in needs to be in the PATH variable (Windows) or the LD_LIBRARY_PATH variable (linux).
     126
     127These JNI bits are located by default in the lib/jni directory. There are two ways to get them into Tomcat:
     128A: Keep all the Greenstone stuff inside the gsdl3 directory, and just modify the environment that Tomcat runs in
     129
     130set LD_LIBRARY_PATH/PATH to include gsdl3/lib/jni directory.
     131add all the jar files in gsdl3/lib/jni directory to the CLASSPATH, then edit tomcats setclasspath.sh/bat to use the system CLASSPATH.
     132(in setclasspath.bat, change
     133set CLASSPATH=%JAVA_HOME%\lib\tools.jar
     134to
     135set CLASSPATH=%JAVA_HOME%\lib\tools.jar;%CLASSPATH%
     136
     137in setclasspath.sh, change
     138# Set standard CLASSPATH
     139if [ "$1" = "debug" -o "$1" = "javac" ] ; then
     140  CLASSPATH="$JAVA_HOME"/lib/tools.jar
     141fi
     142
     143to
     144# Set standard CLASSPATH
     145if [ "$1" = "debug" -o "$1" = "javac" ] ; then
     146  CLASSPATH="$JAVA_HOME"/lib/tools.jar:"CLASSPATH"
     147fi
     148
     149
     150B: Copy the files into Tomcat installation:
     151Move the gsdl3/lib/jni jar files into tomcat's shared/lib directory.
     152Move the gsdl3/lib/jni library files (.so/.dll) into shared/classes, and set LD_LIBARARY_PATH/PATH to include this directory.
     153This has the advantage that you can use this for other webapps without modifying the Tomcat environment.
     154
     155
     156
     157
Note: See TracChangeset for help on using the changeset viewer.