我想使用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