您的位置:首页 > 编程语言 > Java开发

spring 加载失败原因总结

2016-12-08 09:10 302 查看
spring 加载失败原因总结:

严重: Errorconfiguring application listener of class org.springframework.web.context.ContextLoaderListener

原因:spring-web.jar 没导入

解决办法:把maven dependencies中的jar包加入到打包路径中





 Could not resolve placeholder
spring.springframework.beans.factory.BeanDefinitionStoreException:  Invalid bean definition with name '******' defined in null: Could not resolve placeholder 'displayName' 有可能是因为配置了多个 org.springframework.beans.factory.config.PropertyPlaceholderConfigurer 这个配置用于 xml 中的占位符,如下:<property name="driverClassName"value="${jdbc.driverClassName}" />
<property name="url"value="${jdbc.url}" />
<propertyname="username" value="${jdbc.username}" />
<propertyname="password" value="${jdbc.password}" /> 假设 a.xml 配置了一个 PropertyPlaceholderConfigurer ,并且成功了。 后来,b.xml 也配置了一个 PropertyPlaceholderConfigurer ,这时候如果不做特别配置,b.xml 里配置的placeholder将无法使用,并报上面的错误。************************************************************************************************************解决方法:a.xml中配置第一个 PropertyPlaceholderConfigurer 时,将ignoreUnresolvablePlaceholders的值设为true 如下所示:<bean id="myConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:jdbc.properties</value>
</list>
</property>
<propertyname="ignoreUnresolvablePlaceholders" value="true" />
</bean> 这个配置告诉spring,当某个placeholder无法找到时,先不要报错,并尝试用另一个PropertyPlaceholderConfigurer来设置placeholder的值。


eclipse启动tomcat时,工程编译生成的classes文件没有上传到tomcat 上去。

解决方法:1.检查 Deployment Assembly的设置。2.project->clean3.直接找个正常的工程的 .classpath文件替换过来。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: