views:

296

answers:

2

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  A: 

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
Hector Ramos
Answer obtained from http://www.bigsoft.co.uk/blog/index.php/2009/02/01/invalid-activemq-schema-name-space comments. See his solution, which uses local jar, if this one does not work for you. Answered my own question.
Hector Ramos
A: 

I faced the same issue but it worked fine with the above settings. Thanks

Sushil Chugh