java - 将 WAR 文件上传到 WebSphere 6.1 时出现问题

标签 java eclipse websphere jersey war

我正在尝试使用 WAR 文件将 Web 服务部署到 WebSphere,有人直接告诉我这是完全可能的,并且之前已经做过很多次。 WebSphere 允许我上传文件、指定上下文根,甚至启动应用程序。但是,当我尝试通过指定我的底层 URI 来访问它时,WebSphere 404s 出现在我身上。显示的相对无用的错误信息是:

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"?><br/> <web-app version="2.4"<br/> id="WebAppId"<br/> xmlns="http://java.sun.com/xml/ns/j2ee"<br/> xsi="http://www.w3.org/2001/XMLSchema-instance"<br/> schemalocation="http://java.sun.com/xml/ns/j2ee <a href="http://java.sun.com/xml/ns/j2ee/web-app" rel="noreferrer noopener nofollow">http://java.sun.com/xml/ns/j2ee/web-app</a>_2_4.xsd"><br/> <display-name>MYPROJECT'SDISPLAYNAME</display-name><br/> <servlet><br/> <servlet-name>Jersey REST Service</servlet-name> <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class><br/> <init-param><br/> <param-name>com.sun.jersey.config.property.packages</param-name><br/> <param-value>MYPROJECTNAME</param-value><br/> </init-param><br/> <load-on-startup>1</load-on-startup><br/> </servlet><br/> <servlet-mapping><br/> <servlet-name>Jersey REST Service</servlet-name><br/> <url-pattern>/*</url-pattern><br/> </servlet-mapping><br/> </web-app>

另一个编辑

我使用的是最新版本的 Jersey - 这是问题的一部分吗?

又一次编辑

我很确定这就是全部问题。 WebSphere 6.1 运行 jdk1.5,而 Jersey 在 Jersey 1.2 之后停止支持它...

最佳答案

正如您怀疑您的问题是缺乏对 Jersey(或更确切地说是 JAX-RS)的 WebSphere 支持。

我在 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

芒露

关于java - 将 WAR 文件上传到 WebSphere 6.1 时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6279950/

相关文章:

Java:使用 DOM API 解析 xml 文件

java - 我的 Selenium 网格配置有什么问题?

eclipse - 当我需要对属性文件进行资源过滤时,如何在 Eclipse 中运行 Maven webapp?

java - WSWS7263E : The following exception occured : org. apache.axis2.AxisFault:HTTP(503) 不可用地址

Websphere:使用部署描述符配置共享库

java - SQLite在某个ID之前插入?

java - Kafka Stream KTable-KTable 键控连接产生重复事件(检测到乱序 KTable)

java - 实现 ISelectionListener 来监视项目资源管理器中选定的项目

java - 如何消除 Eclipse 中的以下错误?

java - Spring 未分类SQLException : ORA-01012