Tomcat understands amq:broker but Eclipse marks errors in schema

三世轮回 提交于 2019-12-09 06:58:30

问题


When working with ActiveMQ in Eclipse, you might sometimes get a schema parsing error as such:

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'.  

However, the project deploys successfully in Tomcat.


回答1:


To fix this, you must associate the ActiveMQ XSD URL with the schema.

Go to XML->XML Catalog in Preferences, and add a User Specified Entry.

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

Then add a second one:

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

Hit OK.

If you have this same error and Tomcat fails, open the applicationContext-jms.xml file which triggers the error and replace:

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

with

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


来源:https://stackoverflow.com/questions/2289532/tomcat-understands-amqbroker-but-eclipse-marks-errors-in-schema

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!