执行到 这一步的时候 ,DefaultHttpClient httpClient = new DefaultHttpClient(); 报错

来源:2-2 access_token的获取(上)

__莫杨

2015-08-26 18:02

执行到 这一步的时候  ,DefaultHttpClient httpClient = new DefaultHttpClient(); 

报错:

Exception in thread "main" sun.misc.InvalidJarIndexException: Invalid index

at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:939)

at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:848)

at sun.misc.URLClassPath.getResource(URLClassPath.java:199)

at java.net.URLClassLoader$1.run(URLClassLoader.java:358)

at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

at java.lang.ClassLoader.loadClass(ClassLoader.java:425)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)

at java.lang.ClassLoader.loadClass(ClassLoader.java:358)

at org.apache.http.impl.client.AbstractHttpClient.<init>(AbstractHttpClient.java:187)

at org.apache.http.impl.client.DefaultHttpClient.<init>(DefaultHttpClient.java:146)

at com.minmate.likang.weixin.util.WeiXinUtil.doGetStr(WeiXinUtil.java:49)

at com.minmate.likang.weixin.util.WeiXinUtil.getToken(WeiXinUtil.java:123)

at com.minmate.likang.weixin.util.Test.main(Test.java:16)


写回答 关注

1回答

  • Asura_0003
    2015-12-30 21:21:39

    会不会是包导入出错了

Java微信公众号开发进阶

Java微信公众号开发的进阶课程,在入门的基础上更加深入

87757 学习 · 226 问题

查看课程

相似问题