java - HTTP 状态 500 - 未找到 AbstractValueFactoryProvider 类
问题描述
我已经按照以下解决方案来解决我的问题。
但是,我遇到了另一个错误:
HTTP 状态 500 – 内部服务器错误
javax.servlet.ServletException: Servlet [jersey-servlet] 的 Servlet.init() 抛出异常
根本原因
java.lang.NoClassDefFoundError: org/glassfish/jersey/server/internal/inject/AbstractValueFactoryProvider
我发现该类在最新的 Jersey 下载中没有:
https://jersey.github.io/download.html
目前我使用的 Jar 文件列表是:
我对代码所做的当前更改是:
import javax.websocket.server.PathParam;
@Path("{uuid}/{browserinfo}/{ipint}/{lat}/{longitude}/{sessionid}/{spid}/{tr}"
+ "/{jsnum}/{fingerprint}/{methodset}")
@Produces(MediaType.TEXT_PLAIN)
public int adaptiveAuth(
@PathParam("uuid") String uuID,
@PathParam("browserinfo") String browserInfo,
@PathParam("ipint") long ipInt,
@PathParam("lat") double latiTude,
@PathParam("longitude") double longiTude,
@PathParam("sessionid") String sessionID,
@PathParam("spid") String spID,
@PathParam("tr") int tR,
@PathParam("jsnum") int jsNum,
@PathParam("fingerprint") String fingerPrint,
@PathParam("methodset") MethodClass[][] methodSet) throws SQLException{
对如何解决问题有任何想法吗?如果 AbstractValueFactoryProvider 不再支持最新版本的 Jersey,我可以使用什么替换 jar 来使我的代码正常工作?
谢谢你。
解决方案
目前我使用的是最新的 Jersey 版本,所以我根据最新版本更新了特定的 jar。我还将@PathParam 更改为@FormDataParam 并且它有效。我可以查看 wadl 文件。现在继续使用 SOAP UI 测试 Web 服务。谢谢
推荐阅读
- c# - 在 C# 中将具有未知分隔符和可选时间元素的年/月/日字符串解析为 DateTime
- javascript - 如何获取 css 属性并通过 javascript 更改 html 元素的高度
- html - CSS-头像随机改变大小
- python-3.x - 如何创建多维字典
- java - Java 泛型 - 不兼容的界限
- javascript - 如何绑定对象的动态输入框数组
- reactjs - React Native Debugger:为什么我不能在我的 Redux 传奇中设置断点?
- selenium - Internet Explorer WebDriver 在 CreateSession API 调用期间挂起一小时
- ruby-on-rails - 如何在 Rails 6 中使用第二个数据库
- node.js - 什么是 Node.js Buffer.from(string) 的 Deno 等价物