gpt4 book ai didi

Spring RabbitMQ 无法读取架构文档

转载 作者:行者123 更新时间:2023-12-05 07:26:19 34 4
gpt4 key购买 nike

**Spring not able to read XML Schema document for rabbit MQ**

I am trying to run Spring MDP application on windows 8 using Java 8.
I have configured spring file and defined xml schema document for rabbitMQ.

下面是我正在使用的 Spring 上下文文件,我已经定义了所有 bean。 :

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jms="http://www.springframework.org/schema/jms"
xmlns:rabbit="http://www.springframework.org/schema/rabbit"
xsi:schemaLocation="http://www.springframework.org/schema/rabbit http://www.springframework.org/schema/rabbit/spring-rabbit-1.6.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/jms
http://www.springframework.org/schema/jms/spring-jms-4.0.xsd">

I am getting error when trying to start the application :

org.xml.sax.SAXParseException; lineNumber: 159; columnNumber: 64; schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/rabbit/spring-rabbit-1.6.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.warning(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)

该应用程序适用于除 Rabbit mq 之外的所有其他 xml 模式文档。我也尝试过更改 rabbitmq 模式文档版本,但似乎它们都不起作用。

编辑:我没有使用行家。我在类路径中包含了 spring-rabbit-2.0.jar。输入图像描述 here

最佳答案

什么版本的 spring-rabbit?

我怀疑它不是 1.6.x。

最佳实践是不使用版本化模式,Spring 将根据 jar 中的 META-INF 中的 spring.schemas 解析正确的版本。

使用http://www.springframework.org/schema/rabbit/spring-rabbit.xsd

spring-jms.xsd

关于Spring RabbitMQ 无法读取架构文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54424181/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com