HXzhitang_AQ 2020-03-28 21:46 采纳率: 0%
浏览 501

阿里云的姿态检测运行时抛出java.lang.NoClassDefFoundError错误,跪求解决方法?

在这里我使用了阿里云的姿态检测库,但从开始运行时抛出java.lang.NoClassDefFoundError错误导致无法运行:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/conn/HttpClientConnectionManager
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at com.aliyuncs.http.HttpClientFactory.buildClient(HttpClientFactory.java:35)
    at com.aliyuncs.DefaultAcsClient.<init>(DefaultAcsClient.java:77)
    at com.aliyuncs.DefaultAcsClient.<init>(DefaultAcsClient.java:66)
    at com.HUST_fighting.start.Main.main(Main.java:22)
Caused by: java.lang.ClassNotFoundException: org.apache.http.conn.HttpClientConnectionManager
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 6 more

这个错误在网上找了半天没有解决方法。据说是编译时找不到指定类

求大佬找出问题并提供解决建议,以下是源码:

import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.facebody.model.v20191230.BodyPostureRequest;
import com.aliyuncs.facebody.model.v20191230.BodyPostureResponse;

import javax.swing.JButton;
import javax.swing.JOptionPane;

import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;

public class Main {
    static IAcsClient client = null;
    public static void main(String[] args) throws ServerException, ClientException {
        DefaultProfile profile = DefaultProfile.getProfile(
                "cn-shanghai",             //默认
                "xxxxx",         //Access Key 已隐藏
                "xxxxx");
        client = new DefaultAcsClient(profile);
        bodyTest();
    }
    public static void bodyTest() throws ServerException, ClientException {
        BodyPostureRequest body = new BodyPostureRequest();
        body.setImageURL("https://viapi-test.oss-cn-shanghai.aliyuncs.com/test-team/bodyp.jpg");
        BodyPostureResponse bodyp = client.getAcsResponse(body);
        System.out.println(bodyp);
    }
}

图片说明

以下是引用的库:

图片说明

望有大佬提出解决建议!

  • 写回答

1条回答 默认 最新

  • 关注
    评论

报告相同问题?

悬赏问题

  • ¥15 求TYPCE母转母转接头24PIN线路板图
  • ¥100 国外网络搭建,有偿交流
  • ¥15 高价求中通快递查询接口
  • ¥15 解决一个加好友限制问题 或者有好的方案
  • ¥15 急matlab编程仿真二阶震荡系统
  • ¥20 TEC-9的数据通路实验
  • ¥15 ue5 .3之前好好的现在只要是激活关卡就会崩溃
  • ¥50 MATLAB实现圆柱体容器内球形颗粒堆积
  • ¥15 python如何将动态的多个子列表,拼接后进行集合的交集
  • ¥20 vitis-ai量化基于pytorch框架下的yolov5模型