Search code examples
springspring-rabbit

why there is no file spring-rabbit.xsd under http://www.springframework.org/schema/rabbit/


Why http://www.springframework.org keep united way on providing spring-[schema].xsd file.

Today, I coincidentally find that there is no file named spring-rabbit.xsd under URI http://www.springframework.org/schema/rabbit/. But, mostly other schemas have the xsd file named using spring- suffix with their name, i.e : spring-beans.xsd is under http://www.springframework.org/schema/beans/.

So, i'm confused and curious about why this happens?

Here the pictures showing this situation. spring rabbit without spring-rabbit.xsd file in it

spring beans whit spring-beans.xsd file in it


I'm using eclipse to develop my spring project, and the head definition in one of my xml config files is showing bottom:

<?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:rabbit="http://www.springframework.org/schema/rabbit"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/rabbit
        http://www.springframework.org/schema/rabbit/spring-rabbit.xsd">            
<rabbit:admin connection-factory="connectionFactory"/>

With using http://www.springframework.org/schema/rabbit/spring-rabbit.xsd, i get eclipse XML problem: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'rabbit:admin'. application-consumer.xml /my-spring-project/src/main/resources/config line 16 XML Problem

If i using http://www.springframework.org/schema/rabbit/spring-rabbit-1.6.xsd, there is no XML problem.

So, that's why i'm confused, should http://www.springframework.org provide http://www.springframework.org/schema/rabbit/spring-rabbit.xsd like they do in other schema such as beans , data , context and so on.

http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/beans/spring-data.xsd
http://www.springframework.org/schema/context/spring-context.xsd

Solution

  • It's not necessary - spring maps to the appropriate schema for the version you are using, from the jar (the mapping is in /META-INF/spring.schemas).

    The schemas on the internet are not used at all.

    EDIT

    The link is there now.