added exception stack trace logging in Java subagent