首页 > 编程语言 > 详细

spring 装配容器失败- org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException

时间:2018-03-26 13:40:37      阅读:213      评论:0      收藏:0      [点我收藏+]

问题1. 

Context initialization failed

     org.springframework. beans.factory.xml.XmlBeanDefinitionStoreException:Line 1 in XML document from 
file [spring-wlf.xml] is invalid;nested exception is org.xml.sax.SAXParseException:The processing instruction
target matching "[xX][mM][1L]” is not allowed.

 

原因: spring.xml中的文件第一行出现空格: 

 空格<?xml version="1.0" encoding="UTF-8"?>

解决:   删除空格

 

问题2: 

nested exception is og.xml.sax.SAXParseException; lineNumber: 12; columnNumber: 47; cvc-elt.1: 找不到元素 ‘beans‘ 

原因:  <bean 中的命名空间错误,

解决:

到本地的spring-beans.jar或者spring-content.jar中查找,  找到  spring-schemas中的命名空间。

然后复制相应的xmlns等命名空间到spring.xml   文件中。

spring 装配容器失败- org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException

原文:https://www.cnblogs.com/alisonGavin/p/8650266.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!