异常如下:
*******************************
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 9 in XML document from class path resource [conf/applicationContext-security.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'http'.
……
……
……
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'http'.以下为springsecurity配置文件:applicationContext-security.xml
---------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.1.xsd">
<http auto-config='true'>
<intercept-url pattern="/management/login*" access="IS_AUTHENTICATED_ANONYMOUSLY" />
<intercept-url pattern="/management/admin" access="ROLE_ADMIN"/>
<intercept-url pattern="/management/**" access="ROLE_USER"/>
<form-login login-page="/management/login" authentication-failure-url="/management/login?login_error=1"/>
</http>
<authentication-manager>
<authentication-provider>
<user-service>
<user name="admin" password="admin" authorities="ROLE_USER,ROLE_ADMIN"/>
<user name="sharp" password="sharp" authorities="ROLE_USER"/>
</user-service>
</authentication-provider>
</authentication-manager>
<beans:bean id="messageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<beans:property name="basename" value="classpath:org/springframework/security/messages_zh_CN"/>
</beans:bean>
</beans:beans>
---------------------------------分割线------------------------------------------
web.xml文件:
*********************************************************
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>springmvc</display-name>
<description>this is a share project</description>
<!-- spring begin -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:conf/applicationContext-security.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- Spring end -->
<!-- springsecurity -->
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- springsecurity End -->
<!-- SpringMVC begin-->
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springmvc</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<!-- SpringMVC end -->
</web-app>
***************************************************springmvcweb.xmlspringspringsecurity<http>
*******************************
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 9 in XML document from class path resource [conf/applicationContext-security.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'http'.
……
……
……
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'http'.以下为springsecurity配置文件:applicationContext-security.xml
---------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.1.xsd">
<http auto-config='true'>
<intercept-url pattern="/management/login*" access="IS_AUTHENTICATED_ANONYMOUSLY" />
<intercept-url pattern="/management/admin" access="ROLE_ADMIN"/>
<intercept-url pattern="/management/**" access="ROLE_USER"/>
<form-login login-page="/management/login" authentication-failure-url="/management/login?login_error=1"/>
</http>
<authentication-manager>
<authentication-provider>
<user-service>
<user name="admin" password="admin" authorities="ROLE_USER,ROLE_ADMIN"/>
<user name="sharp" password="sharp" authorities="ROLE_USER"/>
</user-service>
</authentication-provider>
</authentication-manager>
<beans:bean id="messageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<beans:property name="basename" value="classpath:org/springframework/security/messages_zh_CN"/>
</beans:bean>
</beans:beans>
---------------------------------分割线------------------------------------------
web.xml文件:
*********************************************************
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>springmvc</display-name>
<description>this is a share project</description>
<!-- spring begin -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:conf/applicationContext-security.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- Spring end -->
<!-- springsecurity -->
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- springsecurity End -->
<!-- SpringMVC begin-->
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springmvc</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<!-- SpringMVC end -->
</web-app>
***************************************************springmvcweb.xmlspringspringsecurity<http>
解决方案 »
- 断网的情况下,启动tomcat用IE打不开tomcat主页,连上网就能打开
- 有使用过jsf客户端验证的Shale Framework吗?
- js help
- MongoDB在Java中的分组查询与SQL分组查询比较???
- 有关两个ActionForm调用同一个Vector的问题想请教一下……急,在线等
- 如何使用Cactus编写servlet测试?
- 问一简单问题!!!(分不够可以再加)
- 初学EJB,提个基本问题???
- java读取xml后然后显示在IE上,保证所见即所得
- MultipartConfig标记
- 在myeclipse使用SSH框架中出现的错误!弄了一天了,心力交瘁。请各位帮帮忙!严重: Exception sending co
- 27岁的女生要不要再换个城市工作呢?
试试?
<s:intercept-url pattern="/management/login*" access="IS_AUTHENTICATED_ANONYMOUSLY" />
<s:intercept-url pattern="/management/admin" access="ROLE_ADMIN"/>
<s:intercept-url pattern="/management/**" access="ROLE_USER"/>
<s:form-login login-page="/management/login" authentication-failure-url="/management/login?login_error=1"/>
</s:http>
……
……
……
Caused by: org.xml.sax.SAXParseException: The prefix "s" for element "s:http" is not bound.