Reputation: 275
I have an error in a spring-boot + jetty app when trying to set spring.jpa.properties.hibernate.javax.cache.uri property value at application.properties file.
When I do:
spring.jpa.properties.hibernate.javax.cache.uri=classpath:/ehcache.xml
The error is:
Caused by: java.lang.IllegalStateException: Cache provider not started
...
Caused by: javax.cache.CacheException: java.net.MalformedURLException: unknown protocol: classpath
Otherwise, if I use a tomcat server as dependency everything works fine.
How can I set the property value in a right way using jetty?
Upvotes: 1
Views: 1381
Reputation: 275
I've found a solution using SpEL:
spring.jpa.properties.hibernate.javax.cache.uri=${ new org.springframework.core.io.ClassPathResource("/ehcache.xml").getURI().toString()}
Upvotes: 3