处理程序调度失败;嵌套的异常是java.lang.NoClassDefFoundError:org / apache / http / client / HttpClient

时间:2019-02-09 09:11:17

标签: java spring wildfly

enter image description here

我尝试打API,然后会发生此类错误-org.springframework.web.util.NestedServletException:处理程序派发失败;嵌套的异常是java.lang.NoClassDefFoundError:org / apache / http / client / HttpClient

2 个答案:

答案 0 :(得分:1)

确保已基于所使用的工具添加了对Apache http组件的依赖关系。点击此链接[Apache HTTP组件的依赖性] [1] https://hc.apache.org/httpcomponents-client-ga/httpclient/dependency-info.html 添加依赖项。

答案 1 :(得分:0)

NoClassDefFoundError表示该类在编译时可用,但在运行时找不到该定义。 尝试升级您的httpclient权限,

<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpclient</artifactId>
    <version>4.5.3</version>
</dependency>

然后运行clean install