- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我们在 WebLogic Server 10.3.4 上运行 Spring 3.0.5 Web 应用程序Solaris with Sun JVM 1.6.0_x 64bit 使用 EhCache 2.4.2 作为缓存图书馆。 WLS 被设置为具有 2 个节点的集群,它们都运行在同一物理机,通过标准启动startManagedWebLogic.sh
脚本(不使用 NodeManager/管理控制台)。
在我们的 ehcache.xml
中,我们设置了这样的磁盘存储路径:
<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd"
updateCheck="false">
<!-- Location of persistent caches on disk -->
<diskStore path="ehcache.disk.store.dir" />
..
根据 the 2.4 series documentation ofEhCache此设置允许设置 JVM 系统属性,以便指定磁盘存储路径。
系统属性在 startManagedWebLogic.sh
中使用标准 JAVA_OPTIONS
元素:
JAVA_OPTIONS="-Dehcache.disk.store.dir=/var/tmp/EhCache-${SERVER_NAME} <other stuff>"
export JAVA_OPTIONS
SERVER_NAME
在这些之前的同一脚本中定义选项。
在集群节点启动期间,我可以看到正在设置的属性正确(包装以提高可读性):
/usr/jdk/jdk1.6.0_21/bin/java -d64 -server -Xms4096m -Xmx4096m
-XX:PermSize=512m -XX:MaxPermSize=512m -XX:+UseParallelOldGC
-verbose:gc -XX:+PrintGCTimeStamps -Dweblogic.Name=Node2 [..]
-Dehcache.disk.store.dir=/var/tmp/EhCache-Node2 [..]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
weblogic.Server
但是,然后使用该应用程序,我可以看到占位符是没有正确替换,因此使用占位符名称而不是实际路径设置:
2012-08-22 11:52:59,426 DEBUG [net.sf.ehcache.CacheManager] - [Creating new CacheManager with default config]
2012-08-22 11:52:59,429 DEBUG [net.sf.ehcache.CacheManager] - [Configuring ehcache from classpath.]
..
2012-08-22 11:52:59,458 DEBUG [net.sf.ehcache.config.DiskStoreConfiguration] - [Disk Store Path: ehcache.disk.store.dir]
..
2012-08-22 11:52:59,586 DEBUG [net.sf.ehcache.store.DiskStore] - [IOException reading index. Creating new index. ]
2012-08-22 11:52:59,587 DEBUG [net.sf.ehcache.store.DiskStore] - [Index file ehcache.disk.store.dir/bookmarksCountForUserCache.index deleted.]
2012-08-22 11:52:59,588 DEBUG [net.sf.ehcache.store.DiskStore] - [Index file ehcache.disk.store.dir/bookmarksCountForUserCache.index created successfully]
2012-08-22 11:52:59,588 DEBUG [net.sf.ehcache.store.DiskStore] - [Index file dirty or empty. Deleting data file bookmarksCountForUserCache.data]
2012-08-22 11:52:59,597 DEBUG [net.sf.ehcache.store.MemoryStore] - [Initialized net.sf.ehcache.store.LruMemoryStore for bookmarksCountForUserCache]
2012-08-22 11:52:59,600 DEBUG [net.sf.ehcache.store.LruMemoryStore] - [bookmarksCountForUserCache Cache: Using SpoolingLinkedHashMap implementation]
2012-08-22 11:52:59,601 DEBUG [net.sf.ehcache.Cache] - [Initialised cache: bookmarksCountForUserCache]
在我的 WLS 域内的文件系统中,我可以看到一个新文件夹ehcache.disk.store.dir
被创建,所以路径被解释为相对路径。
我也试过使用普通字符串ehcache.disk.store.dir
使用标准模式 ${ehcache.disk.store.dir}
,但这仅更改了要使用 ${..}
创建的文件夹名称。
有没有办法使用系统指定每个节点的磁盘存储路径所有节点的属性和相同的 EhCache 配置?
我们的 ehcache.xml
位于已部署的 .war 文件中,因此将是所有集群节点都一样。更改应用程序代码不是一种选择,因为我们已经结束了此版本的代码卡住。但是,我可以调整服务器的启动设置以如上所述设置系统属性。
感谢您的帮助!
最佳答案
使用 -Dehcache.disk.store.dir
系统属性应该仍然有效。
我在通过 hibernate 配置设置属性时也遇到了问题。
关于java - EhCache "ehcache.disk.store.dir"设置不被接受,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12087935/
这个问题在这里已经有了答案: What's the difference between html[lang="en"] and html:lang(en) in CSS? (4 个答案) 关闭 6
关闭。这个问题需要details or clarity .它目前不接受答案。 想改进这个问题吗? 通过 editing this post 添加细节并澄清问题. 关闭 9 年前。 Improve t
来自 ./configure --help: --with-zlib=DIR Include ZLIB support (requires zlib >= 1.0.9) --with-zlib-
我正在尝试检查我的 pod 规范并收到以下错误。 [!]“Classes”存储库中的“Classes”Pod 遇到意外版本目录“ios”。 我的源文件夹设置如下: 类 - iOS - 操作系统 Pod
在 Python 中有一个名为 dir 的内置函数。这用于获取对象所有属性的列表。 我了解它的作用,但我对为什么将其称为 dir 感到困惑。这个名称与从对象中获取属性有什么关系? 最佳答案 IIRC
我正在使用以下方法遍历文件夹: Dim file As Variant file = Dir(myFolder) While (file <> "" ) mySub file '
在 Python 的交互式 shell 中,执行 dir() 会打印一个名称列表。但是在脚本中 dir() 不直接提供任何输出,我必须使用 print(dir())。 不仅仅是dir(),其他内置函数
我明白它的作用,并且一直在使用它。但有趣的是,我还没有找到说明“DIR”的实际含义 的文档。 “目录”似乎不对。 这不是“console.log() 和 console.dir() 之间有什么区别?”
我正在尝试使用字符向量在我的工作目录中创建一系列目录。没有递归,只是迭代。没有什么花哨。例如,我可以很容易地做到这一点: lapply(state.name, dir.create) 它在我的工作目录
dir(x) 和 dir(x.__class__) 有什么区别?后者返回不同的属性列表,但与前者重叠。 例如,SQLAlchemy 的 sqlalchemy.create_engine() 函数创建一
关闭。这个问题需要details or clarity .它目前不接受答案。 想改进这个问题吗? 通过 editing this post 添加细节并澄清问题. 关闭 6 年前。 Improve t
我正在尝试使用 Dir[] 和/或使用 Dir.foreach 对目录进行 glob: files = Dir["#{options[:dir]}/**/*"].reject { |file| Fil
Git 存储库中.gitignore 文件中的/dir 和/dir/ 有区别吗? 以下有何不同? /dir /dir/ /dir/* 最佳答案 是的,这些规则是不同的。 /dir 将匹配文件、目录、链
我正在尝试编译Bootstrap 5.3以及定制的sass文件。。这就是我的东西。奇怪的是,最后一节生成了下面的css。我预计会看到下面的css。它在开头添加了[dir]。为什么要添加[dir]?我怎
我正在尝试编译Bootstrap 5.3以及定制的sass文件。。这就是我的东西。奇怪的是,最后一节生成了下面的css。我预计会看到下面的css。它在开头添加了[dir]。为什么要添加[dir]?我怎
我正在尝试编译Bootstrap 5.3以及定制的sass文件。。这就是我的东西。奇怪的是,最后一节生成了下面的css。我预计会看到下面的css。它在开头添加了[dir]。为什么要添加[dir]?我怎
你可以找到各种文档来指定 XML 文档内容的语言,使用 xml:lang,如下所示: ... HTML 和 XHTML 具有 dir 属性,可让您指定文本在默认情况下应被视为从左到右,还是默认从右到左
当我 echo 时,输出似乎相同编辑它。 我还测试了其他命令,例如 open ,但两者的结果是一样的。 最佳答案 在传统 sh -style 模式匹配,*匹配文件名中的零个或多个字符,因此 * 之间没
我想在不同时间将一个目录复制到另一个目录中。每次,我都希望新名称比以前高一个数字/我希望能够获取该数字并将其存储到变量中。 所以如果我有一个: mymaindir /home/user/dirs/ST
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwar
我是一名优秀的程序员,十分优秀!