| 发表于:2007-11-16 14:46:38 楼主 |
近来做一个struts +spring + hibernate 的web小程序时出现以下错误: 我加载顺序是spring ,hiberante,struts 请高手指点一下小弟:具体原因是什么?为什么会这样? 2007-11-16 14:38:20,703 error [org.apache.catalina.core.containerbase.[catalina].[localhost].[/sshtest3]] - action: null org.springframework.beans.factory.beandefinitionstoreexception: line 5 in xml document from servletcontext resource [/web-inf/applicationcontext.xml] is invalid; nested exception is org.xml.sax.saxparseexception: document root element "beans ", must match doctype root "null ". org.xml.sax.saxparseexception: document root element "beans ", must match doctype root "null ". at org.apache.xerces.util.errorhandlerwrapper.createsaxparseexception(unknown source) at org.apache.xerces.util.errorhandlerwrapper.error(unknown source) at org.apache.xerces.impl.xmlerrorreporter.reporterror(unknown source) at org.apache.xerces.impl.xmlerrorreporter.reporterror(unknown source) at org.apache.xerces.impl.dtd.xmldtdvalidator.rootelementspecified(unknown source) at org.apache.xerces.impl.dtd.xmldtdvalidator.handlestartelement(unknown source) at org.apache.xerces.impl.dtd.xmldtdvalidator.startelement(unknown source) at org.apache.xerces.impl.xmldocumentfragmentscannerimpl.scanstartelement(unknown source) at org.apache.xerces.impl.xmldocumentscannerimpl$contentdispatcher.scanrootelementhook(unknown source) at org.apache.xerces.impl.xmldocumentfragmentscannerimpl$fragmentcontentdispatcher.dispatch(unknown source) at org.apache.xerces.impl.xmldocumentfragmentscannerimpl.scandocument(unknown source) at org.apache.xerces.parsers.xml11configuration.parse(unknown source) at org.apache.xerces.parsers.xml11configuration.parse(unknown source) at org.apache.xerces.parsers.xmlparser.parse(unknown source) at org.apache.xerces.parsers.domparser.parse(unknown source) at org.apache.xerces.jaxp.documentbuilderimpl.parse(unknown source) at javax.xml.parsers.documentbuilder.parse(documentbuilder.java:98) at org.springframework.beans.factory.xml.xmlbeandefinitionreader.loadbeandefinitions(xmlbeandefinitionreader.java:161) at org.springframework.beans.factory.support.abstractbeandefinitionreader.loadbeandefinitions(abstractbeandefinitionreader.java:125) at org.springframework.beans.factory.support.abstractbeandefinitionreader.loadbeandefinitions(abstractbeandefinitionreader.java:141) at org.springframework.web.context.support.xmlwebapplicationcontext.loadbeandefinitions(xmlwebapplicationcontext.java:126) at org.springframework.web.context.support.xmlwebapplicationcontext.loadbeandefinitions(xmlwebapplicationcontext.java:94) at org.springframework.context.support.abstractrefreshableapplicationcontext.refreshbeanfactory(abstractrefreshableapplicationcontext.java:89) at org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:268) at org.springframework.web.context.support.abstractrefreshablewebapplicationcontext.refresh(abstractrefreshablewebapplicationcontext.java:134) at org.springframework.web.struts.contextloaderplugin.createwebapplicationcontext(contextloaderplugin.java:355) at org.springframework.web.struts.contextloaderplugin.initwebapplicationcontext(contextloaderplugin.java:296) at org.springframework.web.struts.contextloaderplugin.init(contextloaderplugin.java:225) at org.apache.struts.action.actionservlet.initmoduleplugins(actionservlet.java:869) at org.apache.struts.action.actionservlet.init(actionservlet.java:336) at javax.servlet.genericservlet.init(genericservlet.java:211) at org.apache.catalina.core.standardwrapper.loadservlet(standardwrapper.java:1091) at org.apache.catalina.core.standardwrapper.load(standardwrapper.java:925) at org.apache.catalina.core.standardcontext.loadonstartup(standardcontext.java:3857) at org.apache.catalina.core.standardcontext.start(standardcontext.java:4118) at org.apache.catalina.core.containerbase.addchildinternal(containerbase.java:759) at org.apache.catalina.core.containerbase.addchild(containerbase.java:739) at org.apache.catalina.core.standardhost.addchild(standardhost.java:524) at org.apache.catalina.startup.hostconfig.deploydirectory(hostconfig.java:894) at org.apache.catalina.startup.hostconfig.deploydirectories(hostconfig.java:857) at org.apache.catalina.startup.hostconfig.deployapps(hostconfig.java:475) at org.apache.catalina.startup.hostconfig.start(hostconfig.java:1102) at org.apache.catalina.startup.hostconfig.lifecycleevent(hostconfig.java:311) at org.apache.catalina.util.lifecyclesupport.firelifecycleevent(lifecyclesupport.java:119) at org.apache.catalina.core.containerbase.start(containerbase.java:1020) at org.apache.catalina.core.standardhost.start(standardhost.java:718) at org.apache.catalina.core.containerbase.start(containerbase.java:1012) at org.apache.catalina.core.standardengine.start(standardengine.java:442) at org.apache.catalina.core.standardservice.start(standardservice.java:450) at org.apache.catalina.core.standardserver.start(standardserver.java:683) at org.apache.catalina.startup.catalina.start(catalina.java:537) at sun.reflect.nativemethodaccessorimpl.invoke0(native method) at sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39) at sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) at java.lang.reflect.method.invoke(method.java:585) at org.apache.catalina.startup.bootstrap.start(bootstrap.java:271) at org.apache.catalina.startup.bootstrap.main(bootstrap.java:409) |
|
|
|
|