首页 > 解决方案 > HTTP 状态 500 - 未找到 AbstractValueFactoryProvider 类

问题描述

我已经按照以下解决方案来解决我的问题。

RESTFUL WS:传递超过 1 个参数

但是,我遇到了另一个错误:

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 来使我的代码正常工作?

谢谢你。

标签: javarestweb-servicesjersey

解决方案


目前我使用的是最新的 Jersey 版本,所以我根据最新版本更新了特定的 jar。我还将@PathParam 更改为@FormDataParam 并且它有效。我可以查看 wadl 文件。现在继续使用 SOAP UI 测试 Web 服务。谢谢


推荐阅读