用spring配置属性文件
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<!--<value>/WEB-INF/oa.properties</value> -->
<value>WEB-INF\oa.properties</value>
<!--<value>oa.properties</value>-->
</property>
</bean>
运行程序时抛异常
org.springframework.beans.factory.BeanInitializationException:
Could not load properties; nested exception is java.io.FileNotFoundException:
class path resource [WEB-INF/oa.properties] cannot be opened because it does not exist
大概是WEB-INF下的内容,要在Tomcat启动后才能访问
于是我在src下建一个oa.properties, ok不再异常
但是,当我启动tomcat后,抛异常:
org.springframework.beans.factory.BeanInitializationException:
Could not load properties; nested exception is java.io.FileNotFoundException:
Could not open ServletContext resource [/oa.properties]
我把属性文件位置改回/WEB-INF/oa.properties, OK,启动tomcat时不再异常
但是,运行程序时又抛第一个异常
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<!--<value>/WEB-INF/oa.properties</value> -->
<value>WEB-INF\oa.properties</value>
<!--<value>oa.properties</value>-->
</property>
</bean>
运行程序时抛异常
org.springframework.beans.factory.BeanInitializationException:
Could not load properties; nested exception is java.io.FileNotFoundException:
class path resource [WEB-INF/oa.properties] cannot be opened because it does not exist
大概是WEB-INF下的内容,要在Tomcat启动后才能访问
于是我在src下建一个oa.properties, ok不再异常
但是,当我启动tomcat后,抛异常:
org.springframework.beans.factory.BeanInitializationException:
Could not load properties; nested exception is java.io.FileNotFoundException:
Could not open ServletContext resource [/oa.properties]
我把属性文件位置改回/WEB-INF/oa.properties, OK,启动tomcat时不再异常
但是,运行程序时又抛第一个异常
解决方案 »
- Servlet完成下载后,如何刷新页面? Cannot call sendRedirect() after the response has been comm
- spring + jpa 不能增删改
- 通过模拟弹出窗口 iframe加载的内容 如何清除掉?
- 出现Exception in thread "main" java.lang.NoClassDefFoundError:
- ibatis+spring+struts2 的问题
- 问大家一个关于spring 的报错
- 请问,谁有webwork2-spring.jar,发到我邮箱,万分感谢
- 请问如何解决在JBulider9.0+Struts1.1的开发环境下中文乱码问题
- java实现在线实时视频传输可以吗?如何做???
- JB6:cannot access directory javax\ejb 为什么会找不到呢,如何解决??
- Java程序中如何抛出403异常
- flash怎么和jsp交互?
<value>classpath:oa.properties</value>
<value>classpath:oa.properties</value>
<value>classpath:oa.properties</value>
--
配置依据一楼给指定classpath路径试下