Question

I have read this question but it didnt really help my problem Jersey with java 5.

When I was using my application on Glassfish with below dependencies all was working fine:

<dependency>
     <groupId>com.sun.jersey</groupId>
     <artifactId>jersey-server</artifactId>
     <version>1.12</version>
</dependency>
<dependency> 
    <groupId>com.sun.jersey</groupId> 
    <artifactId>jersey-json</artifactId> 
    <version>1.12</version> 
</dependency>

When trying to deploy that on WAS 6.1, I got an error that Jersey's ServletContainer class is not in the classpath, so I added below dependency:

<dependency>
    <groupId>com.sun.jersey</groupId>
    <artifactId>jersey-servlet</artifactId>
    <version>1.12</version>
</dependency>

Now the application starts but Im getting below error. The problem is I have Java 5 on my Websphere but the Jersey's ServletContainer class is compiled with Java 6.

java.lang.UnsupportedClassVersionError 
(com/sun/jersey/spi/container/servlet/ServletContainer) 
bad major version at offset=6

I cannot find any dependancy for jersey-servlet where it would be compiled with Java 5. Anyone has any idea what I should do to get this service working on WAS with Java 5?

Was it helpful?

Solution

I believe that Jersey 1.2 was the last version compiled against Java 5. You may need to consider another solution if that's a deal breaker for you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top