Could not initialize class org.keycloak.common.util.KeystoreUtil

As I deploy my app, I get the following error (see title of topic).
at org.keycloak.adapters.HttpClientBuilder.build(HttpClientBuilder.java:347)
at org.keycloak.adapters.KeycloakDeploymentBuilder$2.call(KeycloakDeploymentBuilder.java:174)
at org.keycloak.adapters.KeycloakDeploymentBuilder$2.call(KeycloakDeploymentBuilder.java:167)

line 347 is: KeystoreUtil.loadKeyStore(truststorePath, truststorePassword);

Class KeystoreUtil is located here:

Maybe it fails on the static block:
static {
BouncyIntegration.init();
}

But why would it give an error on BouncyIntegration.init()?
Has anyone had the same problem?