Kong / unirest-java

Unirest in Java: Simplified, lightweight HTTP client library.
http://kong.github.io/unirest-java/
MIT License
2.61k stars 593 forks source link

Could not initialize class kong.unirest.Unirest #323

Closed ghost closed 4 years ago

ghost commented 4 years ago

Describe the bug I am developing a Spring boot microservice with Unirest. The service works well on local but in the staging phase, we have a very strange bug:

{
"timestamp": 1576073804660,
"status": 500,
"error": "Internal Server Error",
"message": "Could not initialize class kong.unirest.Unirest",
"path": "/api/v1/user/"
}

To Reproduce Following code line is being used:

Unirest.get(url);

Environmental Data:

ryber commented 4 years ago

The Unirest jar isn't in your package. How are you deploying? With a WAR or shaded jar? also make sure you haven't listed the Unirest dependency as "provided" in maven/gradle