Camphul / CoinMarketCap-API

CoinMarketCap API client written in Java(supports CMC API v2)
https://coinmarketcap.com/api
GNU General Public License v3.0
24 stars 14 forks source link

Support Jersey 2.26 #2

Closed ivan-masich closed 6 years ago

ivan-masich commented 6 years ago

In case if Jersey dependencies will be managed to version 2.26 we have this exception:

ava.lang.NullPointerException: null
    at com.lucadev.coinmarketcap.GlobalTicker.get(GlobalTicker.java:71)
    at ....refresh(....java:16)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65)
    at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

As an example of when this may be the problem is when we are using Spring Boot 2.0.0.RELEASE as maven parent, in this case many popular dependencies including Jersey are managed to latest stable versions.

As temporary workaround we can change version of Jersey dependencies back to 2.25.1 and then we will don't have this exception.

Camphul commented 6 years ago

Will updated to latest jersey asap. Will keep you updated.

Camphul commented 6 years ago

Upgraded to Jersey 2.26 and released new version onto maven:


<dependency>
  <groupId>com.lucadev</groupId>
  <artifactId>coinmarketcap-api</artifactId>
  <version>1.2</version>
</dependency>