【发布时间】:2014-03-24 08:40:24
【问题描述】:
我有一个分布式系统,上面有 8 个运行 tomcat 的应用服务器。这是一个弹簧应用程序。我想使用一个位于其他一些服务器上的属性文件,所有 tomcat 只会从那里读取它。 我正在使用 ReloadableResourceBundleMessageSource 来使用自动刷新功能。 我的 bean 定义是
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basenames" >
<list>
<value>file:///192.168.1.10//var/rateLimit</value>
</list>
</property>
<property name="cacheSeconds" value="60"></property>
</bean>
我正在调用这样的属性
System.out.println(messageSource.getMessage("testProp", null, null));
我无法使用此 IP 地址加载文件。
你能帮我解决这个问题吗?
【问题讨论】:
-
file:/// 192.168.1.10//var/rateLimit -
您是否在浏览器中查看过该链接?
-
是的,我检查了我可以在浏览器中打开它
标签: java spring tomcat spring-mvc