This is always cause by conflict between different Java JDK at compile time and runtime.

For Example

I use a JDK1.6 to compile a class file, WAR it and deploy to Tomcat server (another machine), but Tomcat server JAVA_HOME or JRE_HOME environment variable is set to JDK.1.5, it will cause

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

This is same with other web server or application server as well, we have to make sure we are using same JDK version to compile and run it.