我是java和maven的新手。我正在尝试运行我在EC2上部署的项目,但是我收到以下错误。
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/HttpException
at TripBuddy.DataCollectorDaemon.App.main(App.java:32)
Caused by: java.lang.ClassNotFoundException: org.apache.http.HttpException
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 1 more
我有以下依赖项:
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.0-alpha4</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
我将第一个依赖项的版本更改为更晚的版本(4.0,4.1.1,4.3),然后代码不构建。我收到错误:异常URISyntaxException永远不会在相应的try语句的主体中抛出