Tomcat了解amq:broker,但Eclipse标记了架构中的错误

在Eclipse中使用ActiveMQ时,有时可能会出现模式解析错误:

Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'amq:broker'. 

但是,该项目在Tomcat中成功部署。

要解决此问题,您必须将ActiveMQ XSD URL与架构相关联。

转到首选项中的XML-> XML目录,然后添加用户指定的条目。

 Location: http://activemq.apache.org/schema/core/activemq-core-5.3.0.xsd Key Type: Namespace Name Key: http://activemq.apache.org/schema/core 

然后添加第二个:

 Location: http://activemq.apache.org/schema/core/activemq-core-5.3.0.xsd Key Type: Schema Location Key: http://activemq.apache.org/schema/core/activemq-core.xsd 

点击确定。

如果您有相同的错误并且Tomcat失败,请打开applicationContext-jms.xml文件,该文件触发错误并替换:

 http://activemq.apache.org/schema/core/activemq-core-5.2.0.xsd 

 http://activemq.apache.org/schema/core/activemq-core.xsd