user1283438
user1283438

Reputation: 33

coherence-cache-config.xml is not getting loaded from the specified location

I am trying to implement Caching through Oracle coherence. My requirement is to place coherence-cache-config.xml in a path and make this override the same file present in jar.

I have mentioned the path in which I have placed customised coherence-cache-config.xml(which I have named as MyConfig.xml) in Arguements under Environment->CoherenceServers->ServerStart. In the same path where I kept MyConfig.xml, I have also kept tangosol-coherence-override.xml. With this tangosol-coherence-override.xml I have created a cluster in weblogic and have associated to the coherence server I am using.

I have successfully started my coherence server through Admin console of weblogic, even then when hit the coherence server for Cache I get "No scheme for cache:"MyCache"". Please suggest me how can I solve this. Same thing if I open the jar and override the coherence-cache-config.xml then it works properly.

Upvotes: 0

Views: 4343

Answers (2)

Sergey Khudyakov
Sergey Khudyakov

Reputation: 1182

Based on Coherence Developer's Guide, there are two ways you can specify a custom path for a cache configuration file:

  1. Setting up configurable-cache-factory-config in tangosol-coherence-override.xml file. See example below:

    <coherence>
        <configurable-cache-factory-config>
            <init-params>
                <init-param>
                    <param-type>java.lang.String</param-type>
                    <param-value system-property="tangosol.coherence.cacheconfig">MyConfig.xml</param-value>
                </init-param>
            </init-params>
        </configurable-cache-factory-config>
    </coherence>
    
  2. Using tangosol.coherence.cacheconfig as a JVM parameter. E.g. java -Dtangosol.coherence.cacheconfig=MyConfig.xml ...

Upvotes: 0

Viktar Charnarutski
Viktar Charnarutski

Reputation: 51

Most probably you have a default cache configuration deployment descriptor loaded.

I would recommend to have it overridden with the tangosol.coherence.cacheconfig system property specified in your server's start-up script. E.g.:

java -Dtangosol.coherence.cacheconfig=/your_local_path/MyConfig.xml

To identify what cache configuration deployment descriptor was loaded, please check your coherence's logs - it should contain the following output:

Loaded cache configuration from resource "file:/your_local_path/MyConfig.xml"

Upvotes: 0

Related Questions