在属性文件中存储treecache集群属性
我正在使用Jboss 4,hibenate,spring和treecache。由于我们有不同的环境,我想将集群信息存储在一个单独的属性文件中,并引用treecache xml文件中的内容。我把
treecache-optimistic.xml
复制到了
jboss-4.2.0.GAserverPearlconf
并在jboss-4.2.0.GAserverPearldeployproperties-service.xml
中设置属性
<attribute name="Properties">
cluster.name=CluterName
cluster.ip=228.1.3.1
cluster.port=48866
</attribute>
我试图在treecache-optimistic.xml中引用它,如下所示:
<attribute name="ClusterName">${cluster.name}</attribute>
启动实例后,我通过JMX发现群集的名称是${cluster.name}
而不是属性的值(ClusterName
)。我认为它无法以某种方式找到属性,但如果我将引用更改为
<attribute name="ClusterName">${cluster.name:DefaultValue}</attribute>
然后我收到以下错误:
异常启动过滤器ServletRequestScopeFilter
org.springframework.beans.factory.BeanCreationException
:在类路径资源[hibernate-spring.xml
]中定义名称为“pearlSessionFactory
”的bean创建错误:调用init
方法失败;嵌套异常是org.hibernate.cache.CacheException
:javax.management.MalformedObjectNameException
:属性的值部分中的字符':'无效
hibernate属性由spring配置:
<!-- Database Property -->
<bean id="hibernatePropertiesPearl"
class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="properties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
<prop key="hibernate.cache.provider_class">org.hibernate.cache.TreeCacheProvider</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.max_fetch_depth">0</prop>
<prop key="hibernate.jdbc.batch_size">0</prop>
我不知道为什么treecache-optimistic.xml
无法处理属性文件:-(
谢谢
佐尔坦
没有找到相关结果
已邀请:
1 个回复
拈吉勉犬姆