我使用的是包含1-admin&的Weblogic 12.1.2。同一台机器中的3个管理服务器(在1个集群下)。我想将一些数据存储到一个缓存(分布式)中,该缓存必须在集群内的所有管理器服务器中可用。 所以我使用的是oracle coherence功能。 每当我开始coherence.sh时,它总是会给出错误说明 “无法加载缓存配置资源文件://coherence-cache-config.xml ”。 我做了一些分析,并且知道它总是从WebLogic附带的coherance.jar中获取配置。甚至在将PRE_CLASSPATH更改为我的自定义coherance.jar之后。它始终指向WebLogic jar。由于这个原因,我无法覆盖“coherence-cache-config.xml”& “Tangosol的相干-Override.xml的”
你能建议一下吗?如何将WebLogic默认的coherance.jar资源覆盖到我的自定义资源?答案 0 :(得分:0)
根据Coherence documentation,默认情况下,Coherence将使用在类路径中找到的第一个coherence-cache-config.xml
文件。但在您的情况下,它会尝试从file://coherence-cache-config.xml
位置加载它。这意味着该文件的位置被覆盖(在tangosol-coherence-override.xml
文件中或通过tangosol.coherence.cacheconfig
系统属性)。
此外,file://coherence-cache-config.xml
似乎不是有效的文件uri。当我尝试做的时候:
new File(new URI("file://coherence-cache-config.xml"))
导致异常
java.lang.IllegalArgumentException: URI has an authority component
因此,请确保在coherence-cache-config.xml
文件中或通过tangosol-coherence-override.xml
系统属性正确设置tangosol.coherence.cacheconfig
文件位置(documentation详细说明,如何操作)。