Catch NoSuchMethodException when instanciate object