LemonDreamin
2016-05-19 09:12
采纳率: 50%
浏览 1.8k
已采纳

webservice测试接口问题

当我运行我所测试的这个类的时候,就出错?appkey和地址都是正确的,为何一直出错呢?

public static void getTotoo() {
ZJSClient zjsClient = new DefaultZJSClient("http://10.10.6.60:9999/zjs-noah-rest/clientBaseInfo/getClientBaseInfoByClientId","test",null);

    ClientBaseInfoGetRequest requet = new ClientBaseInfoGetRequest();

    requet.setClientid("10086");
    requet.setRequestId("12364");

    requet.setTimestamp(new Date().getTime());// 如果没有设置会默认为当前时间

    ClientBaseInfoGetResponse res=null;
    try {
        res = zjsClient.execute(requet);
    } catch (Exception e) {
        e.printStackTrace();
    }
        System.out.println(res .getBody());

    }

Exception in thread "main" java.lang.NoClassDefFoundError: org/glassfish/jersey/client/ClientConfig
at client.api.internal.util.WebUtils.doPost(WebUtils.java:43)
at client.api.DefaultZJSClient.doPost(DefaultZJSClient.java:264)
at client.api.DefaultZJSClient._execute(DefaultZJSClient.java:180)
at client.api.DefaultZJSClient.execute(DefaultZJSClient.java:118)
at com.epoch.cc.totoo.totoo.getTotoo(totoo.java:35)
at com.epoch.cc.totoo.totoo.main(totoo.java:44)
Caused by: java.lang.ClassNotFoundException: org.glassfish.jersey.client.ClientConfig
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 6 more

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • Royal_lr 2016-05-19 09:38
    已采纳

    少了jar包,,导入jersey的jar包就行了

    点赞 评论

相关推荐 更多相似问题