Changeset 31649


Ignore:
Timestamp:
05/05/17 17:23:04 (4 years ago)
Author:
ak19
Message:

Updated GLI's batch and bash scripts to refer to the new JNA jar files and added a description of these jar files, there purpose, their version and where to get them into the lib/README.txt file.

Location:
main/trunk/gli
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/client-gli.bat

    r31648 r31649  
    9898    echo Perl and GSDLHOME (!GSDLHOME!) detected. Downloading is enabled.
    9999    echo.
    100     "%JAVA_EXECUTABLE%" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar;lib/rsyntaxtextarea.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone -gsdl "%GSDLHOME%" -perl "%PERLPATH%" %1 %2 %3 %4 %5 %6 %7 %8 %9
     100    "%JAVA_EXECUTABLE%" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/jna.jar;lib/jna-platform.jar;lib/qfslib.jar;lib/rsyntaxtextarea.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone -gsdl "%GSDLHOME%" -perl "%PERLPATH%" %1 %2 %3 %4 %5 %6 %7 %8 %9
    101101    goto finish
    102102
    103103:nogsdl
    104104echo Since there's no GSDLHOME, client-GLI's download panel will be deactivated.
    105 "%JAVA_EXECUTABLE%" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar;lib/rsyntaxtextarea.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone %1 %2 %3 %4 %5 %6 %7 %8 %9
     105"%JAVA_EXECUTABLE%" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/jna.jar;lib/jna-platform.jar;lib/qfslib.jar;lib/rsyntaxtextarea.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone %1 %2 %3 %4 %5 %6 %7 %8 %9
    106106
    107107:finish
  • main/trunk/gli/client-gli.sh

    r31648 r31649  
    146146fi
    147147
    148 # GS2 only requires -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar. GS3 requires more but it doesn't conflict with GS2:
     148# GS2 only requires -classpath classes/:GLI.jar:lib/apache.jar:lib/jna.jar:lib/jna-platform.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar. GS3 requires more but it doesn't conflict with GS2:
    149149if [ "$local_gs" = "false" ]; then
    150150    echo "Since there's no GSDLHOME, client-GLI's download panel will be deactivated."
    151151    echo
    152     $javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar:lib/commons-codec-1.3.jar:lib/commons-httpclient-3.1-rc1.jar:lib/commons-logging-1.1.jar $custom_vm_args org.greenstone.gatherer.GathererProg -use_remote_greenstone $*
     152    $javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/jna.jar:lib/jna-platform.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar:lib/commons-codec-1.3.jar:lib/commons-httpclient-3.1-rc1.jar:lib/commons-logging-1.1.jar $custom_vm_args org.greenstone.gatherer.GathererProg -use_remote_greenstone $*
    153153else
    154154    gsdlos=`uname -s | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
     
    160160    echo "Downloading is enabled."
    161161    echo
    162     $javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar:lib/commons-codec-1.3.jar:lib/commons-httpclient-3.1-rc1.jar:lib/commons-logging-1.1.jar $custom_vm_args org.greenstone.gatherer.GathererProg -use_remote_greenstone -gsdl "$GSDLHOME" -gsdlos $gsdlos $*
     162    $javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/jna.jar:lib/jna-platform.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar:lib/commons-codec-1.3.jar:lib/commons-httpclient-3.1-rc1.jar:lib/commons-logging-1.1.jar $custom_vm_args org.greenstone.gatherer.GathererProg -use_remote_greenstone -gsdl "$GSDLHOME" -gsdlos $gsdlos $*
    163163fi
    164164
  • main/trunk/gli/gli.bat

    r31647 r31649  
    182182    )
    183183   
    184     if "%_VERSION%" == "3" "%JAVA_EXECUTABLE%" -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar;lib/apache.jar;lib/jna.jar;lib/jna-platform.jar;lib/rsyntaxtextarea.jar org.greenstone.gatherer.GathererProg -gsdl "%GSDLHOME%" -gsdlos %GSDLOS% -gsdl3 "%GSDL3HOME%" -gsdl3src "%GSDL3SRCHOME%" -perl "%PERLPATH%" %1 %2 %3 %4 %5 %6 %7 %8 %9
     184    if "%_VERSION%" == "3" "%JAVA_EXECUTABLE%" -cp classes/;GLI.jar;lib/apache.jar;lib/jna.jar;lib/jna-platform.jar;lib/qfslib.jar;lib/rsyntaxtextarea.jar org.greenstone.gatherer.GathererProg -gsdl "%GSDLHOME%" -gsdlos %GSDLOS% -gsdl3 "%GSDL3HOME%" -gsdl3src "%GSDL3SRCHOME%" -perl "%PERLPATH%" %1 %2 %3 %4 %5 %6 %7 %8 %9
    185185    if ERRORLEVEL 2 (
    186186        goto rungs3
     
    201201    )
    202202
    203     "%JAVA_EXECUTABLE%" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar;lib/apache.jar;lib/jna.jar;lib/jna-platform.jar;lib/rsyntaxtextarea.jar org.greenstone.gatherer.GathererProg -gsdl "%GSDLHOME%" -gsdlos %GSDLOS% -perl "%PERLPATH%" -local_library "%locallib%" %1 %2 %3 %4 %5 %6 %7 %8 %9
     203    "%JAVA_EXECUTABLE%" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/jna.jar;lib/jna-platform.jar;lib/qfslib.jar;lib/rsyntaxtextarea.jar org.greenstone.gatherer.GathererProg -gsdl "%GSDLHOME%" -gsdlos %GSDLOS% -perl "%PERLPATH%" -local_library "%locallib%" %1 %2 %3 %4 %5 %6 %7 %8 %9
    204204    if ERRORLEVEL 2 (
    205205        goto localLib
     
    208208
    209209:webLib
    210     "%JAVA_EXECUTABLE%" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar;lib/apache.jar;lib/jna.jar;lib/jna-platform.jar;lib/rsyntaxtextarea.jar org.greenstone.gatherer.GathererProg -gsdl "%GSDLHOME%" -gsdlos %GSDLOS% -perl "%PERLPATH%" %1 %2 %3 %4 %5 %6 %7 %8 %9
     210    "%JAVA_EXECUTABLE%" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/jna.jar;lib/jna-platform.jar;lib/qfslib.jar;lib/rsyntaxtextarea.jar org.greenstone.gatherer.GathererProg -gsdl "%GSDLHOME%" -gsdlos %GSDLOS% -perl "%PERLPATH%" %1 %2 %3 %4 %5 %6 %7 %8 %9
    211211    if ERRORLEVEL 2 (
    212212        goto webLib
  • main/trunk/gli/gli.sh

    r30119 r31649  
    132132
    133133# basic_command is the cmd string common to both Greenstone 3 and Greenstone 2 execution
    134 #basic_command="$javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar org.greenstone.gatherer.GathererProg"
     134#basic_command="$javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/jna.jar:lib/jna-platform.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar org.greenstone.gatherer.GathererProg"
    135135stop_gli=0
    136136while [ "$stop_gli" = "0" ] ; do
     
    158158# GS2 webLib
    159159    if [ "$PROGABBR" = "FLI" -o ! -f "$GSDLHOME/gs2-server.sh" ]; then
    160         "$javapath" -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar $custom_vm_args org.greenstone.gatherer.GathererProg -gsdl "$GSDLHOME" -gsdlos $GSDLOS $*
     160        "$javapath" -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/jna.jar:lib/jna-platform.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar $custom_vm_args org.greenstone.gatherer.GathererProg -gsdl "$GSDLHOME" -gsdlos $GSDLOS $*
    161161        exit_status=$?
    162162# GS2 localLib
    163163    else
    164         "$javapath" -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar $custom_vm_args org.greenstone.gatherer.GathererProg -gsdl "$GSDLHOME" -gsdlos $GSDLOS -local_library "$GSDLHOME/gs2-server.sh" $*
     164        "$javapath" -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/jna.jar:lib/jna-platform.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar $custom_vm_args org.greenstone.gatherer.GathererProg -gsdl "$GSDLHOME" -gsdlos $GSDLOS -local_library "$GSDLHOME/gs2-server.sh" $*
    165165        exit_status=$?
    166166    fi
    167167# GS3
    168168    elif [ "$_version" -eq 3 ]; then   
    169         "$javapath" -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar $custom_vm_args org.greenstone.gatherer.GathererProg -gsdl "$GSDLHOME" -gsdlos $GSDLOS -gsdl3 "$GSDL3HOME" -gsdl3src "$GSDL3SRCHOME" $*
     169        "$javapath" -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/jna.jar:lib/jna-platform.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar $custom_vm_args org.greenstone.gatherer.GathererProg -gsdl "$GSDLHOME" -gsdlos $GSDLOS -gsdl3 "$GSDL3HOME" -gsdl3src "$GSDL3SRCHOME" $*
    170170        exit_status=$?
    171171    fi
  • main/trunk/gli/lib/README.txt

    r29730 r31649  
    11---------------------------
    2 THE apache.jar FILE
     2A. THE apache.jar FILE
    33---------------------------
    44
     
    88
    99
    10 Commit r29729 adds the contents of xml-apis.jar (sax) and xercesImpl.jar (both found in GS3/web/WEB-INF/lib else packages/tomcat/lib) into apache.jar, replacing the older xerces and xml-apis contained of apache.jar.
     10Commit r29729 adds the contents of xml-apis.jar (sax) and xercesImpl.jar (both found in GS3/web/WEB-INF/lib else packages/tomcat/lib) into apache.jar, replacing the older xerces and xml-apis contained in apache.jar.
    1111This update was necessary to handle commit r29687 where web.xml was split into web.xml and servlets.xml, with the former including the latter as an entity. GLI needs to use an EntityResolver to work with this, but the older xerces and xml-apis in apache.jar would still result in GLI failing to start, unable to parse web.xml because of the way in which servlets.xml was included. The xercesImpl and xml-apis jars in GS3/web/WEB-INF/lib (copied into packages/tomcat/lib) contain versions of these jars that do make the EntityResolver in GLI work.
    1212
     
    5959
    6060
     61------------------------------------------------
     62B. THE jna.jar and jna-platform.jar FILES
     63------------------------------------------------
     64
     65JNA = Java Native Access. These jar files are used by SafeProcess.java (in GLI and GS3 src code) to obtain the process ID of external processes launched by Java, so that on Windows, we can use the process ID to get the process IDs of subprocesses that were launched by our external process, and terminate them successfully.
     66
     67Generally, on Windows, process.destroy() only destroys the external process launched by Java. Not subprocesses.
     68
     69SafeProcess now can terminate an external process and any subprocesses it launched, whereas formerly, on Windows, it would leave subprocesses running as orphans. This was noticed when GLI would run full-import.pl on a build, this would launch import.pl. When the build was cancelled through GLI, the full-import.pl script would be successfully terminated in Windows, but import.pl would still run to termination. A windows specific fix has been added for this, so that cancelling a build through GLI on Windows now does what Linux did by default on Java Process.destroy(): terminate any subprocesses launched by the process.
     70
     71
     72The official JNA source code project had been moved to Github when we discovered we needed it. However, the github JNA project hasn't yet made the jar files available, despite its GettingStarted documentation starting with an instruction to download the jna.jar. See https://github.com/java-native-access/jna/blob/master/www/GettingStarted.md
     73
     74SafeProcess.java currently uses JNA version 4.1.0, which is from 2013. The jna-4.1.0.jar and jna-platform-4.1.0.jar were made available by the Maven MVN repository and were downloaded from https://mvnrepository.com/artifact/net.java.dev.jna/jna/4.1.0 and https://mvnrepository.com/artifact/net.java.dev.jna/jna-platform/4.1.0. See also https://mvnrepository.com/artifact/net.java.dev.jna/jna
     75
     76The 2 JNA jar files were renamed to jna.jar and jna-platform.jar and were placed into gli/lib, for GLI's SafeProcess.java. This required an update to the gli/fli and makegli/makejar bash and batch scripts.
     77For the GS3 source code copy of SafeProcess.java, these files will be placed in web/WEB-INF/lib and may require an update to build.xml for compiling and running.
     78
  • main/trunk/gli/makegli.bat

    r31647 r31649  
    119119    if "%GLILANG%" == "ru" echo Š®¬¯š«šà®¢ ­š¥ %1 š § ¢šáš¬ë¥ ª« ááë...
    120120
    121     "%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/qfslib.jar;lib/jna.jar;lib/jna-platform.jar;lib/rsyntaxtextarea.jar %1
     121    "%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/jna.jar;lib/jna-platform.jar;lib/qfslib.jar;lib/rsyntaxtextarea.jar %1
    122122
    123123    if "%GLILANG%" == "en" echo Done!
     
    140140:: Compile the GLI
    141141:: Sun compiler (tested with 1.5 and 1.6) didn't compile DragTreeSelectionModel.java or MetadataAuditTableModel.java automatically, so we need to put them in explicitly
    142 "%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/qfslib.jar;;lib/jna.jar;lib/jna-platform.jar;lib/rsyntaxtextarea.jar src/org/greenstone/gatherer/GathererProg.java src/org/greenstone/gatherer/util/DragTreeSelectionModel.java src/org/greenstone/gatherer/metadata/MetadataAuditTableModel.java
    143 "%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/qfslib.jar;;lib/jna.jar;lib/jna-platform.jar;lib/rsyntaxtextarea.jar src/org/greenstone/gatherer/GathererApplet.java
    144 :: "%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/qfslib.jar;;lib/jna.jar;lib/jna-platform.jar;lib/rsyntaxtextarea.jar src/org/greenstone/gatherer/GathererApplet4gs3.java
     142"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/jna.jar;lib/jna-platform.jar;lib/qfslib.jar;lib/rsyntaxtextarea.jar src/org/greenstone/gatherer/GathererProg.java src/org/greenstone/gatherer/util/DragTreeSelectionModel.java src/org/greenstone/gatherer/metadata/MetadataAuditTableModel.java
     143"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/jna.jar;lib/jna-platform.jar;lib/qfslib.jar;lib/rsyntaxtextarea.jar src/org/greenstone/gatherer/GathererApplet.java
     144:: "%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/jna.jar;lib/jna-platform.jar;lib/qfslib.jar;lib/rsyntaxtextarea.jar src/org/greenstone/gatherer/GathererApplet4gs3.java
    145145
    146146:: Compile the GEMS
    147 "%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/qfslib.jar;;lib/jna.jar;lib/jna-platform.jar;lib/rsyntaxtextarea.jar src/org/greenstone/gatherer/gems/GEMS.java
     147"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/jna.jar;lib/jna-platform.jar;lib/qfslib.jar;lib/rsyntaxtextarea.jar src/org/greenstone/gatherer/gems/GEMS.java
    148148
    149149:: Compile the standalone programs needed on the server for remote building
  • main/trunk/gli/makegli.sh

    r25683 r31649  
    9999    fi
    100100
    101     $javacpath $JAVACFLAGS -deprecation -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar $*
     101    $javacpath $JAVACFLAGS -deprecation -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/jna.jar:lib/jna-platform.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar $*
    102102
    103103    if [ "$glilang" = "es" ]; then
     
    129129
    130130# Compile the GLI
    131 $javacpath $JAVACFLAGS -deprecation -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar src/org/greenstone/gatherer/GathererProg.java
    132 $javacpath $JAVACFLAGS -deprecation -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar src/org/greenstone/gatherer/GathererApplet.java
    133 #$javacpath -deprecation -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar src/org/greenstone/gatherer/GathererApplet4gs3.java
     131$javacpath $JAVACFLAGS -deprecation -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/jna.jar:lib/jna-platform.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar src/org/greenstone/gatherer/GathererProg.java
     132$javacpath $JAVACFLAGS -deprecation -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/jna.jar:lib/jna-platform.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar src/org/greenstone/gatherer/GathererApplet.java
     133#$javacpath -deprecation -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/jna.jar:lib/jna-platform.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar src/org/greenstone/gatherer/GathererApplet4gs3.java
    134134# Compile the GEMS
    135 $javacpath -deprecation -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar src/org/greenstone/gatherer/gems/GEMS.java
     135$javacpath -deprecation -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/jna.jar:lib/jna-platform.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar src/org/greenstone/gatherer/gems/GEMS.java
    136136
    137137# Compile the standalone programs needed on the server for remote building
  • main/trunk/gli/makejar.bat

    r29729 r31649  
    118118  cd jar
    119119  "!JARPATH!\jar" xf ..\lib\apache.jar com org javax
     120  "!JARPATH!\jar" xf ..\lib\jna.jar com
     121  "!JARPATH!\jar" xf ..\lib\jna-platform.jar com
    120122  "!JARPATH!\jar" xf ..\lib\qfslib.jar de
    121123  "!JARPATH!\jar" xf ..\lib\rsyntaxtextarea.jar org
  • main/trunk/gli/makejar.sh

    r29729 r31649  
    4747cd jar
    4848jar xf ../lib/apache.jar com org javax
     49jar xf ../lib/jna.jar com
     50jar xf ../lib/jna-platform.jar com
    4951jar xf ../lib/qfslib.jar de
    5052jar xf ../lib/rsyntaxtextarea.jar org theme.dtd
Note: See TracChangeset for help on using the changeset viewer.