Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Introduce initial caching support #465

@sdeleuze

Description

@sdeleuze

We have basic configuration for caching in CachingHints, but EhCache is not supported, and enabling caching support in PetClinic JPA with the following configuration:

@Configuration
@EnableCaching
class CacheConfiguration {

	@Bean
	public JCacheManagerCustomizer petclinicCacheConfigurationCustomizer() {
		return cm -> {
			cm.createCache("vets", cacheConfiguration());
		};
	}

	private javax.cache.configuration.Configuration<Object, Object> cacheConfiguration() {
		return new MutableConfiguration<>().setStatisticsEnabled(true);
	}

}

Generates this error that seems to indicate the need for a processor:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'vetController' defined in class path resource [org/springframework/samples/petclinic/vet/VetController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'vetRepository': Post-processing of FactoryBean's singleton object failed; nested exception is com.oracle.svm.core.jdk.UnsupportedFeatureError: Proxy class defined by interfaces [interface org.springframework.samples.petclinic.vet.VetRepository, interface org.springframework.data.repository.Repository, interface org.springframework.transaction.interceptor.TransactionalProxy, interface org.springframework.aop.framework.Advised, interface org.springframework.core.DecoratingProxy, interface java.io.Serializable] not found. Generating proxy classes at runtime is not supported. Proxy classes need to be defined at image build time by specifying the list of interfaces that they implement. To define proxy classes use -H:DynamicProxyConfigurationFiles=<comma-separated-config-files> and -H:DynamicProxyConfigurationResources=<comma-separated-config-resources> options.

We should also document what kind of caching is supported (see the list in CacheType) and bring back caching support in the petclinic-jpa sample as configured in https://github.com/spring-projects/spring-petclinic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: external-projectFor an external project and not something we can fixtype: compatibilityNative image compatibility issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions