spring 配置应该没问题,我加了WEB service才出现的这种情况,没加之前  一切正常,不知道是否是JAR包 有冲突    信息: Loading Spring root WebApplicationContext
2011-1-6 19:11:44 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanDefinitionStoreException: Line 15 in XML document from file [C:\apache-tomcat-6.0.13\apache-tomcat-6.0.13\webapps\Candy\WEB-INF\classes\appContext-commons.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)

解决方案 »

  1.   

    spring的配置有问题吗?不知你的spring是和哪些内容集成在一起的?
      

  2.   

    spring配置文件的头的声明有问题...不完整
      

  3.   

    apache-tomcat-6.0.13\apache-tomcat-6.0.13\webapps\Candy\WEB-INF\classes\appContext-commons.xml] is invalid
    这个提示应该是Spring配置有出问题吧
    楼主再好好检查一下配置
    帖出来大家看看
      

  4.   

    http://blog.163.com/flying_heart/blog/static/98119076200981884055885/
      

  5.   

    明明提示spring的配置文件有问题,还说没问题
      

  6.   

    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-2.5.xsd
    http://www.springframework.org/schema/aop
    http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
    http://www.springframework.org/schema/tx
    http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
    这是我的beans头部。 以前练习用它都没有问题啊!!
      

  7.   

    我的spring是和hibernate、struts1.2集成的    但加入webservers就报错了!!!