spring 加载失败原因总结
2016-12-08 09:10
302 查看
spring 加载失败原因总结:
严重: Errorconfiguring application listener of class org.springframework.web.context.ContextLoaderListener
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的值。
严重: 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文件替换过来。相关文章推荐
- [转载]spring+mybatis加载属性文件设置数据源失败原因及解决方案 - 泡在网上的日子
- 关于dll加载失败原因总结
- CSS加载失败原因的总结与分析
- Spring注入失败可能的几个原因总结
- spring+mybatis 注入properties文件中属性失败导致datasource加载失败的原因和解决
- Spring注入失败的原因
- 加载struts,spring,hibernate出现404错误可能的原因
- 一个创业失败的大学生亲身总结11条原因
- Tomcat页面文件加载失败的原因
- 邮箱css加载失败怎么办 网站css加载异常原因分析
- bootanimation.zip 加载失败的一个原因
- Spring单例模式的一次失败经历和总结
- 项目总结--maven+springsecurity+solr+springmvc+hibernate 延迟加载处理+hibernate sql对象处理(sql执行插入)+spring注解方式+邮件 + JNDI+项目框架写法+jasperreprot的简单应用
- spring自动扫描装配Bean 失败可能的原因
- Spring 依赖注入失败原因
- 个人站长创业失败的原因总结
- PHP 加载 curl.dll 扩展失败的原因和解决方法
- 加载struts,spring,hibernate出现404错误可能的原因
- delphi项目开发经验2008年09月18日 星期四 10:07随着项目的失败,这些天一直在总结失败的原因,到底是为什么?
- Spring加载xml配置文件的方式总结