I'm going to assume a standard Maven layout for your web app, with the src/main directory that contains java, resources and webapp directories within it. There are a number of deployment descriptor and configuration files in there too as shown below.
To configure Coherence for your web application, the tangosol-coherence-override.xml file must be in its classpath. That means it should be present in the WEB-INF/classes directory in your WAR file. Having it in that directory is not enough however, the weblogic.xml file also needs to have the following entry in it...
weblogic.xml
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
The above tells WebLogic to load files/classes found inside the WAR file in preference to those found elsewhere. Since a web application's classpath can include multiple locations across the WebLogic server's file system, it is a good idea to make sure that your web app loads your version of tangosol-coherence-override.xml and not some other one found elsewhere on the classpath.
The above approach works well for JAX-WS services since no additional library overrides are typically required. However if you want to use Jersey with WLS 12.1.2 or anything that forces your weblogic.xml to have the prefer-application-packages element defined the above approach doesn't work.
As per Oracle's documentation -
Note that in order to use prefer-application-packages or prefer-application-resources, prefer-web-inf-classes must be set to false.
So if you set prefer-application-packages in your weblogic.xml you must do the following to get your tangosol-coherence-override.xml file to be read from your WAR package...
weblogic.xml
<prefer-application-resources>
<resource-name>coherence-*.xml</resource-name>
<resource-name>tangosol-*.xml</resource-name>
</prefer-application-resources>
That's it!
So there you go, two approaches for two different deployment types. The end result is your Coherence settings will be read from the WAR file instead of being picked up from another location on the classpath.
-i