platelminto / java-bittrex

Java wrapper for the Bittrex API
MIT License
23 stars 18 forks source link

NoClass found #2

Closed michel5 closed 7 years ago

michel5 commented 7 years ago

Exception in thread "Timer-0" java.lang.NoClassDefFoundError: org/apache/http/nio/reactor/IOReactorException at com.mashape.unirest.http.HttpClientHelper.prepareRequest(HttpClientHelper.java:151) at com.mashape.unirest.http.HttpClientHelper.request(HttpClientHelper.java:131) at com.mashape.unirest.request.BaseRequest.asJson(BaseRequest.java:68)

Caused by: java.lang.ClassNotFoundException: org.apache.http.nio.reactor.IOReactorException 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) ... 10 more

How can i fix this?

platelminto commented 7 years ago

What did you try to do before getting the error?

Also, have you got the dependencies listed in the README?

michel5 commented 7 years ago

I have remove line 27 - 29.

public void UpdateBalance (){
    System.out.println(apiKey);
    System.out.println(apiSecretKey);
    BittrexProtocall bittrexprotocall = new BittrexProtocall(apiKey, apiSecretKey);
    System.out.println(bittrexprotocall.getBalances());
};

I have rename bittrex to BittrexProtocall.java. I add unirest-java-1.4.9.jar and gson-2.2.2.jar in Librarie.

platelminto commented 7 years ago

Try updating Gson to version 2.4 - also, how did you add the libraries? If you haven't used Maven, make sure you've imported all the required packages from both Gson & Unirest

michel5 commented 7 years ago

I have add gson 2.4 and Maven (https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-jar-plugin/3.0.2). But i have still this problem. I have add the libraries in netbeans. Right click on libraries and add jar file and select the jar file then. Can you give your libraries?

platelminto commented 7 years ago

The Unirest dependency has now been removed - use Apache HttpClient with the new source code and it should now work.

michel5 commented 7 years ago

Yeah! Good work! ty