How to load xml config file from WEB-INF

261 views
Skip to first unread message

Gurkirat Singh

unread,
Sep 14, 2016, 3:27:41 AM9/14/16
to Hazelcast
I have my hazelcast-config.xml in WEB-INF along with other config files.
I tried to give the custom config file path to 2nd level cache by below property as described in the hazelcast documentation.

<property name="hibernate.cache.provider_configuration_file_resource_path">
{path to applicationContext-hazelcast.xml}
</property>

But I'm getting following exception:
ERROR 14-Sep-16 11:33:36 ContextLoader:initWebApplicationContext:308 Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ... nested exception is org.hibernate.cache.CacheException: org.hibernate.cache.CacheException: Could not find configuration file: WEB-INF/hazelcast.xml

Any suggestions how can I load my config file from WEB-INF?

t...@hazelcast.com

unread,
Sep 15, 2016, 11:47:10 AM9/15/16
to Hazelcast, gurkira...@paxcel.net

mukul panwar

unread,
Sep 23, 2016, 10:22:45 AM9/23/16
to Hazelcast, gurkira...@paxcel.net
There is another way you can put your hazelcast.xml file in WEB-INF/classes/ folder and load it by mentioning as "classpath:hazelcast.xml" in your configuration.

Thanks
Reply all
Reply to author
Forward
0 new messages