java.lang.NoClassDefFoundError:org / apache / http / client / config / RequestConfig

时间:2014-06-12 21:33:21

标签: java android parse-platform apache-httpclient-4.x parse4j

我将Parse4j导入了我的项目。

我的项目有以下教程:

Parse.initialize("xyz", "abc");
ParseObject team = new ParseObject("GameScore");
team.put("score", 1337);
team.put("playerName", "Neymar");
team.save();

对于最后一行,抛出以下错误:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/client/config/RequestConfig
    at org.parse4j.command.ParseCommand.<clinit>(ParseCommand.java:29)
    at org.parse4j.ParseObject.save(ParseObject.java:443)
    at Main.main(Main.java:16)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.ClassNotFoundException: org.apache.http.client.config.RequestConfig
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    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)
    ... 8 more

不确定这是如何修复的。任何帮助表示赞赏。

1 个答案:

答案 0 :(得分:1)

将以下内容添加到您的pom.xml:

<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpclient</artifactId>
    <version>4.3.3</version>
</dependency>
相关问题