【发布时间】:2017-12-15 10:02:30
【问题描述】:
所以我正在为 Windows 中的Camel Spring boot 项目之一创建一个 docker 容器。在项目中,在我的camelcontext.xml开头我有以下一段代码-
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:camel="http://camel.apache.org/schema/spring"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:security="http://www.springframework.org/schema/security"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
.
.
// remaining part of code
现在,对于 xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd ..." 部分,docker 容器无法访问 .xsd 文件。
另外,不确定是否相关,我有另一个单独的容器,其中包含 jhipster 应用程序,我可以在本地浏览器中打开该应用程序。我还做了一些在线链接中发现的 DNS 更改。 (我的意思是在创建的虚拟交换机中添加 8.8.8.8 和 8.8.4.4)
不知道为什么我无法从容器中访问文件以及问题出在哪里。
以下是我得到的错误 -
线程“main”中的异常 org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: 来自类路径资源的 XML 文档中的第 10 行 [META-INF/spring/camelContext.xml] 无效;嵌套异常是 org.xml.sax.SAXParseException;行号:10;列号:44; cvc-elt.1:找不到元素“beans”的声明。
org.xml.sax.SAXParseException;行号:10;列号:44; cvc-elt.1:找不到元素“beans”的声明。
line 10, column 44 是我在上面粘贴的代码。
PS - xml 文件已验证,我检查它here。
【问题讨论】:
标签: docker spring-boot apache-camel