【发布时间】:2014-05-27 05:50:00
【问题描述】:
我有 xml。 (Ehcache.xml) 我想从属性文件(在类路径上)注入它的属性。
但是,由于这个 xml 不是 Spring 托管的 bean,所以我不能这样做。
有什么建议可以解决这个问题吗?
xml:
...
properties="peerDiscovery=manual,rmiUrls=//**${other.node.hostname}**:41001/org.jasig.cas.ticket.ServiceTicket|//**${other.node.hostname}**:41001/org.jasig.cas.ticket.TicketGrantingTicket"
propertySeparator="," />
<cacheManagerPeerListenerFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="port=41001,socketTimeoutMillis=5000" />
</ehcache>
我想从另一个属性文件中注入 ${other.node.hostname}。
但我在运行时得到了这个:
原因:java.net.URISyntaxException:索引 2 处的权限中存在非法字符://${other.node.hostname}:41001/org.jasig.cas.ticket.TicketGrantingTicket
谢谢, 射线。
【问题讨论】:
标签: java xml spring properties ehcache