2 wxm0646 wxm0646 于 2016.04.15 09:37 提问

maven+springmvc开发的web工程,发布到tomcat时抛出异常,哪位大神给看看

Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [applicationContext.xml]
Offending resource: URL [file:/F:/apache-tomcat-7.0.68/webapps/yjmanage/WEB-INF/classes/spring_config/applicationContext-mvc.xml]; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [applicationContext-security.xml]
Offending resource: URL [file:/F:/apache-tomcat-7.0.68/webapps/yjmanage/WEB-INF/classes/spring_config/applicationContext.xml]; nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 4 in XML document from URL [file:/F:/apache-tomcat-7.0.68/webapps/yjmanage/WEB-INF/classes/spring_config/applicationContext-security.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 121; cvc-elt.1.a: Cannot find the declaration of element 'b:beans'.

6个回答

rui888
rui888   Ds   Rxr 2016.04.15 14:04

应该你是你的配置文件中错了。

applicationContext-security.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 121; cvc-elt.1.a: Cannot find the declaration of element 'b:beans'.

hou1263047562
hou1263047562   2016.04.15 16:05

applicationContext-security.xml

jek123456
jek123456   2016.04.15 18:19

F:/apache-tomcat-7.0.68/webapps/yjmanage/WEB-INF/classes/spring_config/applicationContext-mvc.xml 估计是配置文件错误了

wxm0646
wxm0646   2016.04.15 09:39

以上是tomcat的日志输出,用浏览器访问时报404错误

eguid_1
eguid_1   2016.04.15 09:59

错误日志写的很清楚,监听器初始化失败

wxm0646
wxm0646 那请问大神该如何解决
一年多之前 回复
tcytcy123
tcytcy123   2016.04.15 11:46

404异常,找不到页面,初始化页面出错,或者页面名字不对,检查一下

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!