docker集装箱不能够读取http链接 – 骆驼

所以我正在为Windows中的一个Camel Spring boot项目创buildDocker容器 。 在项目中,在我的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集装箱isn无法访问.xsd文件。

另外,不知道是否相关,我有另一个单独的容器,有一个jijster应用程序,我可以在我的本地浏览器中打开该应用程序。 我也在网上几个链接中发现了DNS更改。 (通过更改,我的意思是在创build的虚拟交换机中添加8.8.8.8和8.8.4.4)

不知道为什么我无法从容器中访问文件,以及问题出在哪里。

下面是我得到的错误 –

线程“main”中的exceptionorg.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:来自类path资源[META-INF / spring / camelContext.xml]的XML文档中的第10行无效; 嵌套的exception是org.xml.sax.SAXParseException; lineNumber:10; columnNumber:44; cvc-elt.1:找不到元素“beans”的声明。

org.xml.sax.SAXParseException; lineNumber:10; columnNumber:44; cvc-elt.1:找不到元素“beans”的声明。

line 10, column 44是我上面粘贴的代码。

PS – 的XML文件进行了validation,我在这里检查。

  1. 请确保问题与DNS无关,只需将www.springframework.orgreplace为您可以通过ping www.springframework.org

  2. --network=host run命令中使用--network=host启动容器。