modify exception handling and some fixes for the JAVA_DSL