我曾與Maven(打包成JAR)的使用內置彈簧項目(依賴被複制到一個單獨的目錄,並添加到類路徑)Maven的春天 - 找不到的聲明元素「豆」
我想運行它爲Java的罐子
的問題是,當我運行它,我得到:
產生的原因:org.xml.sax.SAXParseException:CVC-elt.1:找不到元素的聲明 '豆'。
這是因爲spring.schemas和spring.handlers位於幾個罐子,即:彈簧豆類等
有什麼辦法來解決這個問題,假設我不想用遮蔭插件來解壓縮所有依賴項並連接spring.schemas和spring.handlers的內容?
我也想避免在我的項目中保存xsd文件,並更改schemaLocation指向我的位置。
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/spring"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<camel:camelContext>
<camel:routeBuilder ref="fakeRouteBuilder"/>
</camel:camelContext>
<bean id="fakeRouteBuilder" class="<className>" />
</beans>
你可以粘貼其中一個配置彈簧配置文件嗎?我認爲這個問題可能存在 – Augusto 2011-02-11 17:22:57
` \t <駱駝:camelContext> \t \t <駱駝:routeBuilder REF =」 fakeRouteBuilder「/> \t駱駝:camelContext> \t的 ` –
JJT
2011-02-11 18:07:24
檢查`XSI:schemaLocation`屬性。這似乎是不正確的,但這也可能是由評論中URL的鏈接引起的。事實上,如果你通過添加你以前的評論作爲代碼塊來編輯你的問題會更好,(=選擇代碼並點擊`{}`按鈕使其顯示爲代碼塊) – jasso 2011-02-11 20:57:43