提供ehcache.xml位置的JVM参数

时间:2020-10-02 12:14:11

标签: java ehcache

我正在寻找一种将ehcache.xml的外部位置提供给我的Web应用程序的方法,我已经尝试将ehcache.xml放置在多个位置,但是没有被提取,证据是:

WARN  net.sf.ehcache.config.ConfigurationFactory  - No configuration found. Configuring ehcache from 
ehcache-failsafe.xml  found in the classpath: bundleresource://someid/ehcache-failsafe.xml

我尝试了maven项目的WEB-INF文件夹和资源文件夹。

但是没有人知道通过JVM参数提供它的方法吗?

1 个答案:

答案 0 :(得分:0)

如果您的应用程序使用 Hibernate 作为 ORM 框架 Ehcache 配置文件可以通过 .cfg.xml 文件进行配置。

<property name="net.sf.ehcache.configurationResourceName">file:////path-to-ehcache.xml</property>
相关问题