Could not load cache configuration resource
Exception in thread “main” (Wrapped) java.io.IOException: Could not load cache configuration resource file://example-config.xml
If you are getting below exception while running sample oracle coherence application:
Exception in thread "main" (Wrapped) java.io.IOException: Could not load cache configuration resource file://example-config.xml at com.tangosol.util.Base.ensureRuntimeException(Base.java:289) at com.tangosol.util.Base.ensureRuntimeException(Base.java:270) at com.tangosol.net.ScopedCacheFactoryBuilder.loadConfigFromURI(ScopedCacheFactoryBuilder.java:354) at com.tangosol.net.ScopedCacheFactoryBuilder.buildFactory(ScopedCacheFactoryBuilder.java:383) at com.tangosol.net.ScopedCacheFactoryBuilder.getFactory(ScopedCacheFactoryBuilder.java:267) at com.tangosol.net.ScopedCacheFactoryBuilder.getConfigurableCacheFactory(ScopedCacheFactoryBuilder.java:119) at com.tangosol.net.CacheFactory.getConfigurableCacheFactory(CacheFactory.java:127) at com.tangosol.net.CacheFactory.getCache(CacheFactory.java:205) at com.tangosol.net.CacheFactory.getCache(CacheFactory.java:182) at com.javahonk.HelloWorld.main(HelloWorld.java:14) Caused by: java.io.IOException: Could not load cache configuration resource file://example-config.xml at com.tangosol.net.ScopedCacheFactoryBuilder.loadConfigFromURI(ScopedCacheFactoryBuilder.java:351) ... 7 more 2015-02-18 23:47:57.227/25.486 Oracle Coherence GE 12.1.3.0.0 <D4> (thread=ShutdownHook, member=1): ShutdownHook: stopping cluster node
Solution: It means example-config.xml name have space or the name you are using in tangosol-coherence-override.xml is not correct. Please check spelling of example-config.xml and see if there is any space before or after the file name. In my case it was not working due to space insert before file name. I did correction remove beginning space from the file.
- For more information to run simple coherence application please follow this oracle tutorial