在调试的时候出现了这么一个错误,大家帮忙看一下
严重: 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>
大家看下是什么原因呢?
严重: 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>
大家看下是什么原因呢?
解决方案 »
- weblogic
- 请各位大牛进来,帮小弟看看这个问题!
- Yale CAS如何注销?
- Error allocating a servlet instance应该怎么解决?
- httpclient 抓取动态页面出问题了。
- webservice调用问题?
- 怎么装JIRA?
- 软件开发的流程是怎么样的??
- 求教eclipse中tomcat5.0的启动问题?
- apache是开放源代码的,请问我如何找到.....
- compiere 3.10的源代码如何获得呀,在官方网站上能看见源码,却没有打包好的,急!!!!!
- java.lang.NoClassDefFoundError: org/apache/commons/beanutils/Converter
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
错误报的是这个配置文件,你给WEB.XML没有参考价值。
改成
<param-value>/WEB-INF/springConfig.xml </param-value>
试试
<!--######################### 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 配置 ############################# -->