Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

Fix the issue with different version of Xerces - internal one in JDK and external in lib/. Improve readability of conditionals.

Andrzej Bialecki659b9b6df020
diff --git a/src/bin/nutch b/src/bin/nutch
index 08e1c0751..48f060822 100755
--- a/src/bin/nutch
+++ b/src/bin/nutch
@@ -75,7 +75,6 @@ if [ "$JAVA_HOME" = "" ]; then
exit 1
fi
-local=true
# NUTCH_JOB
if [ -f ${NUTCH_HOME}/nutch-*.job ]; then
@@ -83,6 +82,8 @@ if [ -f ${NUTCH_HOME}/nutch-*.job ]; then
for f in $NUTCH_HOME/nutch-*.job; do
NUTCH_JOB=$f;
done
+else
+ local=true
fi
# cygwin path translation
@@ -189,10 +190,10 @@ else
CLASS=$COMMAND
fi
-# distributed mode
-EXEC_CALL="$HADOOP_HOME/bin/hadoop jar $NUTCH_JOB"
if $local; then
+ # fix for the external Xerces lib issue with SAXParserFactory
+ NUTCH_OPTS="-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl $NUTCH_OPTS"
EXEC_CALL="$JAVA $JAVA_HEAP_MAX $NUTCH_OPTS -classpath $CLASSPATH"
else
# check that we are really in a hadoop config
@@ -200,6 +201,8 @@ else
echo "Can't find Hadoop scripts. Set HADOOP_HOME to a valid home of Hadoop installation."
exit -1;
fi
+ # distributed mode
+ EXEC_CALL="$HADOOP_HOME/bin/hadoop jar $NUTCH_JOB"
fi
# run it