本文介绍了Websphere 8.5 上的 JAX-RS Jersey 客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试部署使用 jersey 的 jax-rs 客户端应用程序是 8.5.
我希望我不需要在战争中打包运动衫罐,因为它会提供它们.
但是在尝试调用我的 servlet 时出现此错误:

I'm trying to deploy jax-rs client application that use jersey on was 8.5.
I was hoping I won't need to pack jersey jars inside my war, because was will provide them.
But I'm getting this error when trying to invoke my servlet:

错误 404: javax.servlet.UnavailableException: SRVE0203E: Servlet [HelloJAXRSClient]: example.HelloJAXRSClient 已找到,但缺少另一个必需的类.SRVE0206E: 此错误通常意味着 servlet 最初是使用服务器无法定位的类编译的.SRVE0187E: 检查您的类路径以确保 servlet 所需的所有类都存在.SRVE0210I: 可以通过仅使用应用程序运行时中的类重新编译 servlet 来调试此问题

我可以做些什么来使用库,这样我就不需要将它们打包到我的应用程序中了吗?

Is there something I can do to use was libraries so I won't need to pack them inside my applicaiton?

推荐答案

WebSphere 8.5 包含一个 JAX-RS 实现,但它基于 Apache Wink,而不是 Jersey.因此,如果您想使用已经提供的内容,我认为您需要 创建一个 Wink 客户端 而不是 Jersey 客户端.

WebSphere 8.5 includes a JAX-RS implementation, but it's based on Apache Wink, not Jersey. So if you want to use what is already provided, I think you'll need to create a Wink client instead of a Jersey one.

或者,您可以 禁用 WAS JAX-RS 实现,我猜这将允许您使用 Jersey,或者部署在您的应用程序中,或者作为 zargarf 建议的共享库.

Or, you can disable the WAS JAX-RS implementation which I'd guess will allow you to use Jersey instead, either deployed in your application or as a shared library as zargarf suggests.

这篇关于Websphere 8.5 上的 JAX-RS Jersey 客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-29 10:39