Make analysis of Java classes more robust

When trying to look up a "getInstance" method on a Java class,
it's necessary to catch more exceptions.