Catching any of the following would work:
java.lang.Throwable
java.lang.Error
java.lang.LinkageError
java.lang.IncompatibleClassChangeError
java.lang.NoSuchMethodError
with the top the most general and the bottom the most specific. Errors are not extended from Exceptions, rather, they are two different types of Throwables.
and what is the solution to this error?
let me explain my problem
i have an applet that loads from a cab file.
an inside i call a method
SecureRandom.getInstance
it works on application(the same code) but not in applet when using cab file
exact error:
-
java.lang.NoSuchMethodError:
java/security/SecureRandom: method getInstance(Ljava/lang/String;Ljava/lang/String;)Ljava/security/SecureRandom; not found
--
Yours
Andrew
To start with it shouldn't be necessary to catch this kind of error.
You're probably getting this error because when it is running as an applet it is using an older version of the java.security.SecureRandom class, which doesn't have the method you are trying to call.
regards
Nick
> To start with it shouldn't be necessary to catch this
> kind of error.
>
> You're probably getting this error because when it is
> running as an applet it is using an older version of
> the java.security.SecureRandom class, which doesn't
> have the method you are trying to call.
>
> regards
>
> Nick
so what's the solution?
please visit this link to see what i mean:
http://forum.java.sun.com/thread.jsp?forum=423&thread=335414
This error means that one version of the class that you call from your code was used at compile time, and an other version was used at runtime.
Try to recompile your code (I guess you have already done that) and check your class path at the place you compile and at the place you execute. There is probably some differences (Don't only check the jar names or directories imported but also their content).
If you the code that raise the exception is not your code, then it means that you have a wrong version of one (or more) jar in your classpath. Check what is in your class path and check what says the release note of the component that raise the exception.