You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current CacheAutoConfiguration has the following condition: @ConditionalOnMissingBean({ CacheManager.class, CacheResolver.class }). If you want to configure your own custom CacheResolver, something along the lines of
Then it blows up because the CacheManager is no longer configured. And it isn't because we've defined a CacheResolver.
But we haven't configured theCacheResolver: we just have configured aCacheResolver that can be used in a dedicated service.
Maybe we should use a bean name rather than a type.
The exception is also misleading:
java.lang.IllegalStateException: No CacheResolver specified, and no bean of type CacheManager found. Register a CacheManager bean or remove the @EnableCaching annotation from your configuration.
The text was updated successfully, but these errors were encountered:
snicoll
changed the title
Cache auto-configuration triggers early init and prevents the use of custom CacheResolver
Allow custom CacheResolver to be configured
Feb 29, 2016
Previously, if a bean of type `CacheResolver` was present in the context
the whole cache auto-configuration would back off. If said
`CacheResolver` hasn't been defined via the `CachingConfigurer`
infrastructure, the application context would fail with a rather
unpleasant error message.
It can be quite common to define custom `CacheResolver` beans as the cache
annotations allow to defines custom cache resolvers per operation. This
commit makes sure that the cache auto-configuration will back-off only if
the `CacheResolver` is named `cacheResolver`.
Closesspring-projectsgh-5201
The current
CacheAutoConfiguration
has the following condition:@ConditionalOnMissingBean({ CacheManager.class, CacheResolver.class })
. If you want to configure your own customCacheResolver
, something along the lines ofThen it blows up because the
CacheManager
is no longer configured. And it isn't because we've defined aCacheResolver
.But we haven't configured the
CacheResolver
: we just have configured aCacheResolver
that can be used in a dedicated service.Maybe we should use a bean name rather than a type.
The exception is also misleading:
The text was updated successfully, but these errors were encountered: