I am new to java and maven. I am trying to run a project that I deployed on EC2 but I get the following error.
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
I have the following dependencies:
<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>
I changed the version of the first dependency to a later one(4.0 , 4.1.1, 4.3) and then the code doesnt build. I get error: exception URISyntaxException is never thrown in body of corresponding try statement