8

http://static.springsource.org/spring-amqp/docs/1.0.x/reference/html/提到了rabbit:命名空间,但从未提到架构位置是什么。谷歌搜索(和命名约定)最终得到:

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

但是这个文件不存在。那么xsd在哪里呢?

4

6 回答 6

9

今天的 XML 模式位于:

http://www.springframework.org/schema/rabbit/spring-rabbit-1.3.xsd
http://www.springframework.org/schema/rabbit/spring-rabbit-1.4.xsd
http://www.springframework.org/schema/rabbit/spring-rabbit-1.5.xsd

选择任何你需要的!

于 2013-04-25T15:15:42.290 回答
7

As a temporary solution, I'm using this schema location to enable autocomplete. Otherwise it is located in the spring-rabbit jar (but the IDE does not detect it):

That is (from a comment from stacker):

I have the following at the top of my schema declaration:

<?xml version="1.0" encoding="UTF-8"?>
<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:rabbit="http://www.springframework.org/schema/rabbit"
        xsi:schemaLocation="
            http://www.springframework.org/schema/beans 
            http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
            http://www.springframework.org/schema/context
            http://www.springframework.org/schema/context/spring-context-3.1.xsd
            http://www.springframework.org/schema/rabbit
            https://raw.github.com/SpringSource/spring-amqp/master/spring-rabbit/src/main/resources/org/springframework/amqp/rabbit/config/spring-rabbit-1.0.xsd">
于 2011-07-27T08:59:30.593 回答
6

我确认Bozho 的解决方案

所以基本上在我的模式声明的顶部,我有以下内容:

<?xml version="1.0" encoding="UTF-8"?>
<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:rabbit="http://www.springframework.org/schema/rabbit"
        xsi:schemaLocation="
            http://www.springframework.org/schema/beans 
            http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
            http://www.springframework.org/schema/context
            http://www.springframework.org/schema/context/spring-context-3.1.xsd
            http://www.springframework.org/schema/rabbit
            https://raw.github.com/SpringSource/spring-amqp/master/spring-rabbit/src/main/resources/org/springframework/amqp/rabbit/config/spring-rabbit-1.0.xsd">
于 2011-08-24T23:39:35.963 回答
4

找到一个带有 META-INF/spring.schemas 的 spring jar,它引用了 rabbit xsd。通过添加此 maven 依赖项在我的配置中解决了该问题

    <dependency>
        <groupId>org.springframework.integration</groupId>
        <artifactId>spring-integration-amqp</artifactId>
        <version>2.1.3.RELEASE</version>
    </dependency>

或者

    <dependency>
        <groupId>org.springframework.amqp</groupId>
        <artifactId>spring-rabbit</artifactId>
        <version>1.1.1.RELEASE</version>
    </dependency>
于 2012-09-27T02:49:45.347 回答
2

我知道这个问题比较老,我的回答在最初的问题时可能不会奏效,但如果有人在今天之后遇到这个问题......

春兔xsd目前位于:

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

要使用它,您的类路径中必须有 spring-rabbit-1.0.0.RELEASE.jar。

于 2012-05-10T18:51:42.700 回答
1

它应该包含在 AMQP jar 中。根据这个线程,您应该使用快照版本而不是 RC1,然后您应该不会收到任何错误。

于 2011-07-19T11:35:31.637 回答