2017-04-17 39 views
0

爲什麼http://www.springframework.org保持統一的方式提供spring- [schema] .xsd文件。爲什麼沒有文件spring-rabbit.xsd在http://www.springframework.org/schema/rabbit/

今天,我巧合地發現在URI http://www.springframework.org/schema/rabbit/下沒有名爲spring-rabbit.xsd的文件。但是,大多數其他模式的xsd文件的名稱都使用spring-suffix命名,即:spring-beans.xsd在http://www.springframework.org/schema/beans/之下。

所以,我很困惑,好奇爲什麼會發生這種情況?

這裏是顯示這種情況的圖片。 spring rabbit without spring-rabbit.xsd file in it

spring beans whit spring-beans.xsd file in it


我使用Eclipse來開發我的Spring項目,並在我的XML配置文件一個頭部定義出底部:

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

對於使用http://www.springframework.org/schema/rabbit/spring-rabbit.xsd ,我得到日蝕XML問題: 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

如果我使用http://www.springframework.org/schema/rabbit/spring-rabbit-1.6.xsd,則不存在XML問題。

所以,這就是爲什麼我很困惑,應該http://www.springframework.org提供http://www.springframework.org/schema/rabbit/spring-rabbit.xsd像他們在其他架構,如豆,數據,上下文等。

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 

回答

0

這是沒有必要 - 春天的地圖爲您正在使用的版本,從罐子適當的架構(映射爲/META-INF/spring.schemas)。

互聯網上的模式根本沒有使用。

編輯

的鏈接,如果現在。

+0

我爲我的問題添加了附加信息,eclipse中存在問題,並且在執行環境中沒有錯誤。爲什麼'http:// www.springframework.org'聯合提供spring- [schema] .xsd文件。 – klvoek

+0

我將添加鏈接,但通常使用支持Spring的IDE(例如spring eclipse插件或[STS eclipse bundle](https://spring.io/tools/sts))並啓用Spring項目性質)或IntelliJ IDEA;這些IDE知道Spring如何解決架構。 –

+0

鏈接現在在那裏。 –

相關問題