You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ju...@apache.org on 2013/05/30 05:26:33 UTC

git commit: kafka-259; Give better error message when trying to run shell scripts without having built/downloaded the jars yet; patched by Ashwanth Fernando; reviewed by Jun Rao

Updated Branches:
  refs/heads/0.8 bbb161aa2 -> 436dd25a4


kafka-259; Give better error message when trying to run shell scripts without having built/downloaded the jars yet; patched by Ashwanth Fernando; reviewed by Jun Rao


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/436dd25a
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/436dd25a
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/436dd25a

Branch: refs/heads/0.8
Commit: 436dd25a4885fa13749604111000f52724eb4ccd
Parents: bbb161a
Author: Jun Rao <ju...@gmail.com>
Authored: Wed May 29 20:26:08 2013 -0700
Committer: Jun Rao <ju...@gmail.com>
Committed: Wed May 29 20:26:08 2013 -0700

----------------------------------------------------------------------
 bin/kafka-run-class.sh |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/436dd25a/bin/kafka-run-class.sh
----------------------------------------------------------------------
diff --git a/bin/kafka-run-class.sh b/bin/kafka-run-class.sh
index 978447d..1b66655 100755
--- a/bin/kafka-run-class.sh
+++ b/bin/kafka-run-class.sh
@@ -65,3 +65,19 @@ else
 fi
 
 $JAVA $KAFKA_OPTS $KAFKA_JMX_OPTS -cp $CLASSPATH "$@"
+
+exitval=$?
+
+if [ $exitval -eq "1" ] ; then 
+	$JAVA $KAFKA_OPTS $KAFKA_JMX_OPTS -cp $CLASSPATH "$@" >& exception.txt
+	exception=`cat exception.txt`
+	noBuildMessage='Please build the project using sbt. Documentation is available at http://kafka.apache.org/'
+	pattern="(Could not find or load main class)|(java\.lang\.NoClassDefFoundError)"
+	match=`echo $exception | grep -E "$pattern"`
+	if [[ -n "$match" ]]; then 
+		echo $noBuildMessage
+	fi
+	rm exception.txt
+fi
+
+