Skip to main content

Posts

Showing posts from April, 2008

java.lang.UnsupportedClassVersionError: Bad version number in .class file

java.lang.UnsupportedClassVersionError: Bad version number in .class file
[at java.lang.ClassLoader.defineClass1(Native Method)]
is an error that you may face in running a compiled java class file.

So as you can see from the stack trace, a class has not been loaded. But which class? The problem is this error message does not show the name of the failed .class, isn't it?

No, it is not. This error is caused when you compile a .java file with one version of JDK and running the .class file with a different version of JVM.
Confused? You may say; same version is not required to compile and run.

Yes, that is true. But you can not run .class files that are compiled with a newer version than the JVM.

Say; javac (compile) - version: X java (run) - version: Y If X is newer than Y; then you may face this issue at runtime.

Now you know how to solve this issue, isn't it?

java.lang.SecurityException: Blocked attempt to access interface - Issue in GWT 1.4.6 upgrade

Exception while dispatching incoming RPC call
java.lang.SecurityException: Blocked attempt to access interface 'http://localhost/myApp/org.kamal.project.module/', which is either not implemented by this servlet or which doesn't extend RemoteService; this is either misconfiguration or a hack attempt


The GWT application was working fine earlier; so decided to upgrade to the new GWT version. But!!! with the upgrade, application failed with a Security exception.

Above is an extract from the exception thrown by GWT, while upgrading old GWT application to GWT 1.4.6 version.

Even though SecurityException is thrown, most possible cause for the above error is; old gwt-servlet.jar file has not been replaced with the new gwt-servlet.jar in the server side. (Make sure you replace all the old jar files in a upgrade).

By placing the new gwt-servlet.jar file inside the lib directory on your server, this issue will be resolved.

Complete stack trace would look as below.
Exception whil…
Creative Commons License Digizol by Kamal Mettananda is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License .
URL of this page must be supplied in attribution
© 2004-2017