简体   繁体   English

Java 5在Websphere上的Jersey REST服务

[英]Jersey REST service on Websphere with Java 5

I have read this question but it didnt really help my problem Jersey with java 5 . 我已经阅读了这个问题,但是它并没有真正帮助我的问题用Java 5解决

When I was using my application on Glassfish with below dependencies all was working fine: 当我在具有以下依赖项的Glassfish上使用我的应用程序时,一切运行正常:

<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: 当尝试在WAS 6.1上部署它时,我收到一个错误,指出Jersey的ServletContainer类不在类路径中,因此我在下面添加了依赖项:

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

Now the application starts but Im getting below error. 现在,该应用程序启动,但是Im低于错误。 The problem is I have Java 5 on my Websphere but the Jersey's ServletContainer class is compiled with Java 6. 问题是我在Websphere上安装了Java 5,但是Jersey的ServletContainer类是使用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? 我找不到对用Java 5进行编译的jersey-servlet的依赖关系。有人知道如何使该服务在Java 5的WAS上运行应该做什么?

我相信Jersey 1.2是针对Java 5编译的最新版本。如果这对您来说很重要,那么您可能需要考虑另一种解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM