spring rabbit XSD在哪里(兔子的架构位置:命名空间)

时间:2011-07-19 10:54:39

标签: spring spring-rabbit spring-amqp

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

  

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

但此文件不存在。那么xsd在哪里?

6 个答案:

答案 0 :(得分: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

选择你需要的任何东西!

答案 1 :(得分:7)

作为临时解决方案,我正在使用this schema location启用自动填充功能。否则它位于spring-rabbit jar中(但IDE没有检测到它):

那是(来自comment from stacker):

我在架构声明的顶部有以下内容:

<?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">

答案 2 :(得分:6)

我确认Bozho's solution

所以基本上在我的架构声明的顶部我有以下内容:

<?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">

答案 3 :(得分:4)

找一个带有META-INF / spring.schemas的弹簧罐,它引用了兔子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>

答案 4 :(得分:2)

我知道这个问题比较老了,我的回答可能在最初的问题时没有用,但如果有人在今天之后发现这个问题......

春兔xsd目前位于:

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

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

答案 5 :(得分:1)

它应该包含在AMQP罐子里。根据{{​​3}}线程,您应该使用快照版本而不是RC1,然后您不应该收到任何错误。