From 039487ae5f21880205bd2ae9ab430b8048974bf7 Mon Sep 17 00:00:00 2001 From: Ashwanth Fernando Date: Tue, 14 May 2013 16:00:43 -0700 Subject: [PATCH 1/2] KAFKA-259 --- bin/kafka-run-class.sh | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/bin/kafka-run-class.sh b/bin/kafka-run-class.sh index e055d67..6e2a22a 100755 --- a/bin/kafka-run-class.sh +++ b/bin/kafka-run-class.sh @@ -81,3 +81,16 @@ 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 +fi -- 1.7.5.4 From 284faae4f054b467e86209adaaad3874bfc635cb Mon Sep 17 00:00:00 2001 From: Ashwanth Fernando Date: Tue, 14 May 2013 16:24:44 -0700 Subject: [PATCH 2/2] KAFKA-259 --- bin/kafka-run-class.sh | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/bin/kafka-run-class.sh b/bin/kafka-run-class.sh index 6e2a22a..71d2aa8 100755 --- a/bin/kafka-run-class.sh +++ b/bin/kafka-run-class.sh @@ -93,4 +93,5 @@ if [ $exitval -eq "1" ] ; then if [[ -n "$match" ]]; then echo $noBuildMessage fi + rm exception.txt fi -- 1.7.5.4