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

发布于 2024-11-14 14:46:23 字数 2027 浏览 2 评论 0 原文

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

错误 404:SRVE0202E:Servlet [Jersey REST Service]:com.sun.jersey.spi.container.servlet.ServletContainer 已找到,但已损坏:SRVE0227I:1. 检查类驻留在正确的包目录中。 SRVE0228I: 2. 检查是否已使用正确的大小写和完全限定的包在服务器中定义了类名。 SRVE0229I: 3. 检查是否使用二进制传输模式将该类传输到文件系统。 SRVE0230I: 4. 检查该类是否使用正确的大小写(如类定义中所定义)进行编译。 SRVE0231E: 5. 检查类文件在编译后是否未重命名。

我已经检查了我的命名约定,根据 博客文章,尝试 将其打包到一个ear文件中(这会抛出当我尝试上传它时发现它自己的错误),并试图找出我可能有错误的配置。我有什么想法可以改变以使其发挥作用吗?

编辑

以下是我的 web.xml 文件的相关部分:


<网络应用程序版本=“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">
<显示名称>MYPROJECT'SDISPLAYNAME

泽西 REST 服务 com.sun.jersey.spi.container.servlet.ServletContainer
<初始化参数>
<参数名称>com.sun.jersey.config.property.packages
<参数值>MYPROJECTNAME

<启动时加载>1


泽西岛 REST 服务
/*

另一个编辑

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

又一个编辑

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

I'm trying to deploy a web service onto WebSphere using a WAR file, which I have been told directly is completely possible and has been done many times before. WebSphere allows me to upload the file, specify the context root, and even start the application. However, when I try to access it by specifying my underlying URIs, WebSphere 404s on me. The relatively useless error message displayed is:

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.

I have checked my naming conventions, modified my web.xml according to this blog post, attempted packaging it into an ear file (which threw out its own errors when I tried to upload it), and am trying to figure out what configurations I might have wrong. Any ideas of what I could change to make this work?

Edit

Here is the relevant part of my web.xml file:

<?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>

Another Edit

I'm using the newest release of Jersey- is that part of the problem?

Yet Another Edit

I'm pretty sure that's the entire problem. WebSphere 6.1 runs jdk1.5, and Jersey stopped supporting that after Jersey 1.2...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

毁梦 2024-11-21 14:46:23

正如您怀疑您的问题是缺少 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

As you suspect your problem is lack for WebSphere support for Jersey (or rather JAX-RS).

I don't see JAX-RS in the list of supported APIs by WAS.

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

WAS 6.1 runs on J2SE 1.5 (as seen in the URL above)

Specification or API Version 6.1

Java 2 Standard Edition (J2SE) specification J2SE 5

These probably are the reasons behind the errors that you get to see in your WAS 6.1

HTH

Manglu

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文