在调试的时候出现了这么一个错误,大家帮忙看一下
严重: Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Line 14 in XML document from ServletContext resource [/WEB-INF/springConfig.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Attribute "value" must be declared for element type "property".
org.xml.sax.SAXParseException: Attribute "value" must be declared for element type "property".
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)我的WEB.xml的配置如下
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
  <display-name>defaultroot</display-name>
  <servlet>
   <servlet-name>dispatcher</servlet-name>
   <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
   <init-param>
   <param-name>contextConfigLocation</param-name>
   <param-value>WEB-INF/springConfig.xml</param-value>
   </init-param>
  </servlet>
  <servlet-mapping>
   <servlet-name>dispatcher</servlet-name>
   <url-pattern>*.lzw</url-pattern>
  </servlet-mapping>
</web-app>
大家看下是什么原因呢?

解决方案 »

  1.   

    SAXParseException:
     Attribute "value" must be declared for element type "property". 
    org.xml.sax.SAXParseException: Attribute "value" must be declared for element type "property". 
    根据这两句错误去找答案。 Attribute "value" must be 
      

  2.   

     Attribute "value" must be declared for element type "property". "value" must be declared value=''这个一定要声明,你没有声明。
      

  3.   

    [/WEB-INF/springConfig.xml]
    错误报的是这个配置文件,你给WEB.XML没有参考价值。
      

  4.   

    <param-value>WEB-INF/springConfig.xml </param-value> 
    改成
    <param-value>/WEB-INF/springConfig.xml </param-value> 
    试试
      

  5.   

    或者直接使用另一种配置方式:
    <!--######################### spring 配置 ##############################
    # -->

    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:spring_base.xml</param-value>
    </context-param>

    <!--Spring ApplicationContext 载入 -->
       <listener>
      <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
      </listener>
     
     
      <context-param>
    <param-name>log4jConfigLocation</param-name>
    <param-value>classpath:log4j_java91.properties</param-value>
    </context-param>

    <listener>
    <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
    </listener> 
                     <!-- 
    #
    ############################ spring 配置 ############################# -->