【发布时间】:2013-04-15 13:53:32
【问题描述】:
我对 Spring Security 有疑问。 Eclipse 在 spring-security.xml 中找不到 html 标记并出现此错误:
Caused by: org.xml.sax.SAXParseException; lineNumber: 12; columnNumber: 28; cvc-complex-type.2.4.c :
The matching wildcard is strict, but no declaration can be found for element 'http'
这里是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.1.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="/**" access="ROLE_USER"/>
</http>
<authentication-manager>
<authentication-provider>
<user-service>
<user name="user1" password="1111" authorities="ROLE_USER"/>
</user-service>
</authentication-provider>
</authentication-manager>
</beans:beans>
问题出在第一个标签 html 上,但我找不到 xsd 配置的任何问题。
有什么想法吗?
非常感谢。
【问题讨论】:
-
你确定是关于
http标签吗?错误消息中的坐标指向上述 xml 中的pattern值。您收到的完整错误消息是什么? -
这里是完整的错误信息:Caused by: org.xml.sax.SAXParseException;行号:12;列号:28; cvc-complex-type.2.4.c : Le caractère générique concordant est strict, mais aucune declaration ne peut être trouvée pour l'élément
'http'。对不起法国人!但是你可以看到http标签;) -
请检查 Spring jar 是否丢失,您使用的是 Maven 吗?
-
是的,但实际上,maven 和 spring 安全性存在问题。当我放置依赖项时,我在一个有两个错误的视图上有一个错误。
The hierarchy of the type RepartitionExcelReportView is inconsistent在类名上,The hierarchy of the type RepartitionExcelReportView is inconsistent在父类上。我找不到任何解决方案,所以目前我将 jar 直接包含在构建路径中。 -
好吧,我回来了这个版本,因为这里有一个问题。有什么想法可以纠正这些层次结构问题吗?