2011-06-08 97 views
3

我想使用WAR文件將Web服務部署到WebSphere上,我已經直接告訴了這個文件是完全可能的,並且之前已經完成了很多次。 WebSphere允許我上傳文件,指定上下文根,甚至啓動應用程序。但是,當我嘗試通過指定我的基礎URI,WebSphere 404s來訪問它時。顯示相對無用的錯誤消息是:發生問題將WAR文件上傳到WebSphere 6.1

Error 404: SRVE0202E: Servlet [Jersey REST Service]: com.sun.jersey.spi.container.servlet.ServletContainer was found, but is corrupt: SRVE0227I: 1. Check that the class resides in the proper package directory. SRVE0228I: 2. Check that the classname has been defined in the server using the proper case and fully qualified package. SRVE0229I: 3. Check that the class was transferred to the filesystem using a binary transfer mode. SRVE0230I: 4. Check that the class was compiled using the proper case (as defined in the class definition). SRVE0231E: 5. Check that the class file was not renamed after it was compiled.

我檢查我的命名約定,根據this博客文章修改了我的web.xml,試圖packaging it into an ear file(其中拋出了自己的錯誤,當我試圖把它上傳),並試圖弄清楚我可能有什麼錯誤配置。任何想法,我可以改變,使這項工作?

編輯

這裏是我的web.xml文件中的相關部分:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
id="WebAppId"
xmlns="http://java.sun.com/xml/ns/j2ee"
xsi="http://www.w3.org/2001/XMLSchema-instance"
schemalocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app _2_4.xsd">
<display-name>MYPROJECT'SDISPLAYNAME</display-name>
<servlet>
<servlet-name>Jersey REST Service</servlet-name> <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>MYPROJECTNAME</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Jersey REST Service</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>

另一個編輯

我使用Jersey-的最新版本這是問題的一部分嗎?

然而,另一個編輯

我敢肯定這是整個問題。 WebSphere 6.1運行jdk1.5,Jersey停止支持澤西1.2之後的版本......

+0

可以分享戰爭文件的結構和配置文件。 – Kamahire 2011-06-08 14:10:32

+0

@Kamahire我從Eclipse中導出它,所以我不確定包含的所有東西,但是我的類根據輸入的URI調用不同的方法(例如root/foo/bar會調用MethodA,root/foo/bar /派對會調用MethodB)。我將添加包含的web.xml文件的相關代碼片段。 – ZKSteffel 2011-06-08 14:30:54

回答

1

正如您懷疑您的問題缺乏WebSphere對Jersey(或者說JAX-RS)的支持。

我在WAS支持的API列表中看不到JAX-RS。

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.help.ic.WS.doc/info_sching.html

WAS 6.1 J2SE 1.5(如圖上面的URL)

規格或API版本運行6.1

Java 2標準版(J2SE)規範J2SE 5

這些可能是您在WAS 6.1中看到的錯誤的原因。

HTH

Manglu

+1

是的,就是這樣。我降級到澤西島1.2(也運行J2SE 1.5),並得到它上傳,現在我只是得到其他的錯誤,我需要錘鍊出來。 – ZKSteffel 2011-06-09 13:35:22

+1

...而那些其他錯誤是由於更多的驅動程序與J2SE 1.5不兼容導致的,我需要降級。 – ZKSteffel 2011-06-09 14:59:24