[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

java.lang.RuntimeException error when running the checkstyle hook

From: emerson cargnin <echofloripa.yell_at_gmail.com>
Date: 2006-06-23 18:53:48 CEST

I get the following message

svn: 'pre-commit' hook failed with error output:
trunk/modules/com.yell.crawler/src/java/com/yell/crawler/HTMLDocumentProcessor.java:0:
Got an exception - java.lang.RuntimeException: Unable to get class
information for AttributeNotFoundException.

Does some know why do I get this error?

he goes my hook script:

#!/bin/sh
REPOS="$1"
TXN="$2"
SVNLOOK=/usr/bin/svnlook
JAVA=/usr/java/j2sdk1.4.2_08/bin/java
CHECKSTYLE=/subversion/tools/checkstyle/lib/checkstyle-all-4.1.jar
TMPDIR=/tmp/$TXN
REPORT=/tmp/$TXN/report
CHECKSTYLE_CONFIG=/subversion/tools/checkstyle/conf/yell_checks.xml
# Make sure there is a log message
if ! $SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" > /dev/null ; then
   echo "You need to supply a comment" > /dev/stderr
   exit 1
fi

# Do not allow commits to the /tags directory
if $SVNLOOK changed -t "$TXN" "$REPOS" | awk '{print $2}' |\
       grep -q "^tags" ; then
   /bin/echo "Cannot commit to tags" 1>&2
   exit 1
fi

# Run checkstyle on java files
CHANGED=`$SVNLOOK changed -t "$TXN" "$REPOS" | grep -v "^D" |\
        awk '{print $2}'`
mkdir -p $TMPDIR
X=0
for LINE in $CHANGED ; do
   FILE=`echo $LINE | egrep \\.java$`
   if [ -n "$FILE" ] ; then
       $SVNLOOK cat $REPOS --transaction $TXN $FILE > $TMPDIR/tmpfile.java
       $JAVA -jar $CHECKSTYLE -c $CHECKSTYLE_CONFIG $TMPDIR/tmpfile.java \
> $TMPDIR/tmpfile.checkstyle
       X=$(($X + $?))
       cat $TMPDIR/tmpfile.checkstyle |\
           grep -v "^Starting audit...$\|^Audit done.$" |\
           sed -e "s@$TMPDIR/tmpfile.java@$FILE@" \
>> $REPORT
       fi
done
if [ $X -ne 0 ] ; then
   cat $REPORT > /dev/stderr
   rm -Rf $TMPDIR
   exit 1
fi
rm -Rf $TMPDIR
exit 0

thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Jun 23 18:55:50 2006

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.