5

在 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 中成功部署。

4

1 回答 1

7

要解决此问题,您必须将 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
于 2010-02-18T15:05:42.090 回答