views:

430

answers:

2
WARNING: error instantiating 'java.util.logging.FileHandler,' referenced by handlers, class not found
java.lang.ClassNotFoundException: java.util.logging.FileHandler,
   at java.lang.Class.forName(libgcj.so.7rh)
   at java.util.logging.LogManager.locateClass(libgcj.so.7rh)
   at java.util.logging.LogManager.createInstance(libgcj.so.7rh)
   at java.util.logging.LogManager.readConfiguration(libgcj.so.7rh)
   at vists.VisTS.main(VisTS.java:64)
Exception in thread "main" java.lang.NullPointerException
   at java.util.logging.Logger.addHandler(libgcj.so.7rh)
   at java.util.logging.LogManager.readConfiguration(libgcj.so.7rh)
   at vists.VisTS.main(VisTS.java:64)
./SampleStartVisTsData.sh: line 5: cd..: command not found

I am unable to find out the errors that I got while running the batch file

The following is the shellscript:

cd ../../classes
export CLASSPATH=$CLASSPATH:../vismine.jar:../mysql-connector-java-5.1.6-bin.jar
java -Xm500m vists.VisTS ../ConfigFiles/dataCenterMySQL-log.xml
cd..

Help needed.

+1  A: 

You have cd.. on line 5 when you should have cd .. (Note the spaces)

Steve Weet
That's one of the problems, for sure.
Jonathan Leffler
+1  A: 

One of the errors is the 'cd..' command, which would need a space in it 'cd ..' if it were not redundant anyway. Your script changes directory to run Java in the correct place, but there's no need to change directory again before exiting - this is Linux and not DOS (where it was necessary; and your exiting cd does not return you to where you started).

It seems odd to change to the classes directory and then expect to find jar files in the directory above - are you sure that's right?

It would probably be sensible to ensure that the first cd works, too:

error(){
    echo "$@" 1>&2
    exit 1
}
cd ../../classes || exit 1
[ -r ../vismine.jar ] || error "did not find vismine.jar"
[ -r ../mysql-connector-java-5.1.6-bin.jar ] ||
    error "did not find mysql-connector-java-5.1.6-bin.jar"
export CLASSPATH=$CLASSPATH:../vismine.jar:../mysql-connector-java-5.1.6-bin.jar
java -Xm500m vists.VisTS ../ConfigFiles/dataCenterMySQL-log.xml

In principle, you could export CLASSPATH for the Java command alone by writing:

CLASSPATH=$CLASSPATH:../vismine.jar:../mysql-connector-java-5.1.6-bin.jar \
java -Xm500m vists.VisTS ../ConfigFiles/dataCenterMySQL-log.xml

However, it isn't worth it this time since it would spread over two lines of code anyway.

Jonathan Leffler