-
Notifications
You must be signed in to change notification settings - Fork 41.7k
Closed
Description
As discussed on the gitter channel I extend the CachesEndpoint with my own functionality:
public class MyCachesEndpoint extends CachesEndpoint {
and then I register it like this:
@Bean(name = MyCachesEndpoint.NAME)
@ConditionalOnEnabledEndpoint
public CachesEndpoint defaultMyCachesEndpoint(ObjectProvider<Map<String, CacheManager>> cacheManagers) {
return new MyCachesEndpoint(cacheManagers.getIfAvailable(LinkedHashMap::new));
}
but then when I start the server I get:
Caused by: java.lang.IllegalStateException: Invalid extension 'cachesEndpointWebExtension': no endpoint found with type 'org.springframework.boot.actuate.cache.CachesEndpoint'
at org.springframework.util.Assert.state(Assert.java:94)
at org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer.addExtensionBeans(EndpointDiscoverer.java:155)
at org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer.discoverEndpoints(EndpointDiscoverer.java:123)
Looks like the EndpointDiscoverer is trying to find a bean of type CachesEndpoint:
EndpointBean endpointBean = byType.get(extensionBean.getEndpointType());
but the byType map contains MyCachesEndpoint.class instead of CachesEndpoint.class. So to overcome this I will have to register also a CachesEndpointWebExtension
Metadata
Metadata
Assignees
Labels
type: bugA general bugA general bug