aerogear / keycloak-metrics-spi

Adds a Metrics Endpoint to Keycloak
Apache License 2.0
526 stars 151 forks source link

Doesn't work with Keycloak 16 #124

Closed hypery2k closed 2 years ago

hypery2k commented 2 years ago

Description

metrics spi prevents Keycloak from Booting

Expected Behavior

Normal boot

Actual Behavior

Keycloak doesn't start:

07:03:10,616 FATAL [org.keycloak.services] (ServerService Thread Pool -- 52) Error during startup: java.lang.NoSuchMethodError: 'org.jboss.resteasy.core.interception.ContainerRequestFilterRegistry org.jboss.resteasy.spi.ResteasyProviderFactory.getContainerRequestFilterRegistry()'
    at deployment.keycloak-metrics-spi-2.5.3.jar//org.jboss.aerogear.keycloak.metrics.MetricsEndpointFactory.init(MetricsEndpointFactory.java:18)
    at org.keycloak.keycloak-services@16.0.0//org.keycloak.services.DefaultKeycloakSessionFactory.loadFactories(DefaultKeycloakSessionFactory.java:297)
    at org.keycloak.keycloak-services@16.0.0//org.keycloak.services.DefaultKeycloakSessionFactory.init(DefaultKeycloakSessionFactory.java:110)
    at org.keycloak.keycloak-services@16.0.0//org.keycloak.services.resources.KeycloakApplication.createSessionFactory(KeycloakApplication.java:233)
    at org.keycloak.keycloak-services@16.0.0//org.keycloak.services.resources.KeycloakApplication.startup(KeycloakApplication.java:124)
    at org.keycloak.keycloak-wildfly-extensions@16.0.0//org.keycloak.provider.wildfly.WildflyPlatform.onStartup(WildflyPlatform.java:36)
    at org.keycloak.keycloak-services@16.0.0//org.keycloak.services.resources.KeycloakApplication.<init>(KeycloakApplication.java:114)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)

Environment

jonathanvila commented 2 years ago

After some investigation these are my findings :

That should be the problem , the change to abstract.

pb82 commented 2 years ago

@jonathanvila thanks for the thorough investigation. #120 targets Keycloak 15, but includes a fix that should make in work on RestEasy 3 and 4. It's different than your suggested solution though.

If you get a chance to try the new release (2.5.3) with this fix on Keycloak 16, that would be very appreciated!

joggeli34 commented 2 years ago

It work for me with keycloak 16.1.0 and SPI 2.5.3, thanks

hypery2k commented 2 years ago

can confirm that it's working with Keycloak 15.0.2 and 16.1.0