mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 15:03:18 +00:00
Merge pull request #8508 from mwoodiupui/8507
Shorten the classpath in bin/start-handle-server to address inconsistent ClassNotFound
This commit is contained in:
@@ -10,23 +10,23 @@
|
|||||||
# This is a Unix shell script for running a command-line DSpace tool.
|
# This is a Unix shell script for running a command-line DSpace tool.
|
||||||
# It sets the CLASSPATH appropriately before invoking Java.
|
# It sets the CLASSPATH appropriately before invoking Java.
|
||||||
|
|
||||||
|
# Assume that this script is in the bin subdirectory of the DSpace installation directory.
|
||||||
BINDIR=`dirname $0`
|
BINDIR=`dirname $0`
|
||||||
DSPACEDIR=`cd "$BINDIR/.." ; pwd`
|
DSPACEDIR=`cd "$BINDIR/.." ; pwd`
|
||||||
|
|
||||||
# Get the JARs in $DSPACEDIR/jsp/WEB-INF/lib, separated by ':'
|
# Get the JARs in $DSPACEDIR/lib
|
||||||
JARS="$DSPACEDIR/lib/*"
|
JARS="$DSPACEDIR/lib/*"
|
||||||
|
|
||||||
# Class path for DSpace will be:
|
# Class path for DSpace will be:
|
||||||
# Any existing classpath
|
# Any existing classpath
|
||||||
# The JARs (WEB-INF/lib/*.jar)
|
# The JARs (lib/*.jar)
|
||||||
# The WEB-INF/classes directory
|
# The configuration directory
|
||||||
if [ "$CLASSPATH" = "" ]; then
|
if [ "$CLASSPATH" = "" ]; then
|
||||||
FULLPATH=$JARS:$DSPACEDIR/config
|
FULLPATH=$JARS:$DSPACEDIR/config
|
||||||
else
|
else
|
||||||
FULLPATH=$CLASSPATH:$JARS:$DSPACEDIR/config
|
FULLPATH=$CLASSPATH:$JARS:$DSPACEDIR/config
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# If the user only wants the CLASSPATH, just give it now.
|
# If the user only wants the CLASSPATH, just give it now.
|
||||||
if [ "$1" = "classpath" ]; then
|
if [ "$1" = "classpath" ]; then
|
||||||
echo $FULLPATH
|
echo $FULLPATH
|
||||||
|
@@ -10,7 +10,8 @@
|
|||||||
# Unix shell script for starting Handle server. WARNING this assumes any
|
# Unix shell script for starting Handle server. WARNING this assumes any
|
||||||
# previously running Handle servers have been terminated.
|
# previously running Handle servers have been terminated.
|
||||||
|
|
||||||
# Assume we're in the bin subdirectory of the DSpace installation directory
|
# Assume that this script is in the bin subdirectory of the DSpace
|
||||||
|
# installation directory.
|
||||||
BINDIR=`dirname $0`
|
BINDIR=`dirname $0`
|
||||||
|
|
||||||
# Read parameters from DSpace config
|
# Read parameters from DSpace config
|
||||||
@@ -21,19 +22,10 @@ HANDLEDIR=`$BINDIR/dspace dsprop --property handle.dir`
|
|||||||
# If you want your handle server logs stored elsewhere, change this value
|
# If you want your handle server logs stored elsewhere, change this value
|
||||||
LOGDIR=$DSPACEDIR/log
|
LOGDIR=$DSPACEDIR/log
|
||||||
|
|
||||||
# Get the JARs in $DSPACEDIR/jsp/WEB-INF/lib, separated by ':'
|
|
||||||
JARS=`echo $DSPACEDIR/lib/*.jar | sed 's/ /\:/g'`
|
|
||||||
|
|
||||||
# Class path for DSpace will be:
|
|
||||||
# Any existing classpath
|
|
||||||
# The JARs (WEB-INF/lib/*.jar)
|
|
||||||
# The WEB-INF/classes directory
|
|
||||||
FULLPATH=$CLASSPATH:$JARS:$DSPACEDIR/config
|
|
||||||
|
|
||||||
#Allow user to specify java options through JAVA_OPTS variable
|
#Allow user to specify java options through JAVA_OPTS variable
|
||||||
if [ "$JAVA_OPTS" = "" ]; then
|
if [ "$JAVA_OPTS" = "" ]; then
|
||||||
#Default Java to use 256MB of memory
|
#Default Java to use 256MB of memory
|
||||||
JAVA_OPTS=-Xmx256m
|
JAVA_OPTS=-Xmx256m
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove lock file, in case the old Handle server did not shut down properly
|
# Remove lock file, in case the old Handle server did not shut down properly
|
||||||
@@ -42,4 +34,8 @@ rm -f $HANDLEDIR/txns/lock
|
|||||||
# Start the Handle server, with a special log4j properties file.
|
# Start the Handle server, with a special log4j properties file.
|
||||||
# We cannot simply write to the same logs, since log4j
|
# We cannot simply write to the same logs, since log4j
|
||||||
# does not support more than one JVM writing to the same rolling log.
|
# does not support more than one JVM writing to the same rolling log.
|
||||||
nohup java $JAVA_OPTS -classpath $FULLPATH -Ddspace.log.init.disable=true -Dlog4j.configuration=log4j-handle-plugin.properties net.handle.server.Main $HANDLEDIR </dev/null >> $LOGDIR/handle-server.log 2>&1 &
|
nohup java $JAVA_OPTS -classpath `$BINDIR/dspace classpath` \
|
||||||
|
-Ddspace.log.init.disable=true \
|
||||||
|
-Dlog4j.configuration=log4j-handle-plugin.properties \
|
||||||
|
net.handle.server.Main $HANDLEDIR \
|
||||||
|
</dev/null >> $LOGDIR/handle-server.log 2>&1 &
|
||||||
|
Reference in New Issue
Block a user