NoSuchMethodError
is not derived from Exception
:
java.lang.Object
java.lang.Throwable
java.lang.Error
java.lang.LinkageError
java.lang.IncompatibleClassChangeError
java.lang.NoSuchMethodError
so will not be caught by the posted catch
clause. Change to catch Throwable
or add a separate catch
clause for Error
and handle differently (attempt to recover from an Exception
but report an Error
and do not attempt to recover for example).