java - Jetty 的 XML 模式错误

标签 java xml xsd spring-security jetty

我在 jetty 中运行 spring 配置时遇到问题。我在 tomcat 中使用了完全相同的文件,没有任何问题。我得到的错误如下。

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 6 in XML document from ServletContext resource [/WEB-INF/web-application-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. Saw 'SpringSource.org | '.
Caused by: org.xml.sax.SAXParseException: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. Saw 'SpringSource.org | '.

我的架构如下所示。

<?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.0.5.xsd">

我不知道哪里出了问题。已使用 2 种不同的配置对其进行测试,但均出现此错误。

最佳答案

以下网址好像无效,重定向到springsource.org

http://www.springframework.org/schema/security/spring-security-3.0.5.xsd

你能试试那个吗?

http://www.springframework.org/schema/security/spring-security-3.0.4.xsd

关于java - Jetty 的 XML 模式错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4313975/

相关文章:

java - 使用 JNA 启动/停止服务

java - 在 Spring Boot 中提供通用异常处理程序,将所有异常转换为 HTTP 500

java - 类型嵌套时 TYPE_USE 注释丢失,通用接口(interface)

xml - 定义一次 xsd 枚举即可在多个地方使用?

xml - JAXB 绑定(bind)自定义

java - JAXB XSD namespace 解码返回 null

java - 如何使用 Java 检测和替换字符串中的不可打印字符?

Python SVG 解析器

JavaScript - 解析 XML 数据

java - 如何删除重复的 XML 声明