0

I am using jre 1.5 tomcat server. In my application I am calling a web service. When I call the web service I got the following error.

java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)

So I found that the problem is with jax-ws jar file.

I am using following jar file in my application build path.

jaxws-api-2.0.jar

I just added only this jar file. I suspect this jar is not compiled under jre 1.5.

Please help me how to get rid of this issue. Or point me to a jar file which can work under jre 1.5.

6
  • 1
    Java 1.5 is rather old in the meantime, any chance to upgrade? Commented May 31, 2014 at 8:06
  • @Henry No chance to upgrade .. Any alternative. Commented May 31, 2014 at 8:10
  • @RomanC I tried that .. My Compiler and everything is in JDK 1.5 only.. JRE1.5 only.. And I can fiund least version for jax-ws is jaxws-api-2.0.jar which is not spporting .. Commented May 31, 2014 at 8:12
  • 1
    You would really really be better off upgrading - it's worth putting significant effort into that. JDK 1.5 is over 10 years old now... how confident are you that there aren't security problems that haven't been patched on your machine? Commented May 31, 2014 at 8:16
  • 2
    "No chance to upgrade" - why? Seriously, if you are running a Tomcat server, upgrading your JVM is always a possibility. The only plausible reason not to is that your management is clinically risk averse ... and ignorant of the risks of running old / unpatched software. Commented May 31, 2014 at 8:28

1 Answer 1

2

Firstly, your best option is upgrade to Java 7 (or better still 8), and consider upgrading to a more recent release of Tomcat.

The Java 5 platform is truly ancient, and (free) security patches were discontinued a number of years ago. So unless you are paying for Oracle Java maintenance, your JVM is likely to have a number of unpatched security flaws in it.

There is really no solid reason to not upgrade if you are running Tomcat, especially since you are apparently building / deploying new webapps to it.


If you can't, then your best bet is to download the source code for the JAXWS 2.0 API and attempt to compile it with a Java 5 compiler. However:

  • I've not been able to track down the JAXWS 2.0 API source code. The closest I could find was 2.2.
  • There is a chance that the JAXWS 2.x API source code won't compile under Java 5.

Related Question: JAX-WS RI on Java 5.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.