switch exception class to java to avoid problems with jdk7