我想使用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之後的版本......
可以分享戰爭文件的結構和配置文件。 – Kamahire 2011-06-08 14:10:32
@Kamahire我從Eclipse中導出它,所以我不確定包含的所有東西,但是我的類根據輸入的URI調用不同的方法(例如root/foo/bar會調用MethodA,root/foo/bar /派對會調用MethodB)。我將添加包含的web.xml文件的相關代碼片段。 – ZKSteffel 2011-06-08 14:30:54