beanscontainer will allow you to use ActiveMQ’s
When the application is deployed (in Tomcat) it will work as expected, however if you try to run it under Eclipse the container fails to start with the message:
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:amq="http://activemq.apache.org/schema/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd"> <amq:broker start="true" brokerName="bs-localhost"> <amq:networkConnectors> <!-- more configurations --> </amq:networkConnectors> </amq:broker> </bean>
org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://activemq.apache.org/schema/core/activemq-core.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is notThe
. 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'. </xsd>
amq:brokermaybe replaced with
amq:connectionFactorydepending on which name elements you have actually used. In order for Eclipse to understand the
amqname space you must add xbean support for ActiveMQ. This is achieved by adding
xbean-spring-3.4.jarto your dynamic web project. According to the ActiveMQ website the XSD declaration will be automatically fished out of the jar and used to help Eclipse give you features like command completion for the XML schema. In fact what happens, is that Eclipse lights up like a Christmas tree moaning that it can’t find the schema declaration. Below is a set of instructions to tell Eclipse how to associate the
activemq-core.xsdurl with the
activemq-core.xsdfound in the jar file which is shipped as part of ActiveMQ.
- Select Windows->Preferences from the Eclipse menu bar.
- Select XML->XML Catalog from the left hand configuration tree.
- Highlight User Specified Entries and select Add.
- The Add XML Catalog Entry windows appears.
- In the Location enter the path to the activemq-all jar, then add !/activemq.xsd to the end of the jar name. e.g.
- Under KeyType enter Namespace Name
- and under Key enter http://activemq.apache.org/schema/core
- then click Ok.
- Now we need to do the same for the other name space file, so hit Add again.
- In the Location enter the path to the activemq-all jar, then add !/activemq.xsd to the end of the jar name. e.g. jar:file:C:/Java/libs/activemq/apache-activemq-5.2.0/activemq-all-5.2.0.jar!/activemq.xsd
- Under KeyType enter Schema Location
- and under Key enter http://activemq.apache.org/schema/core/activemq-core.xsd
- Click Ok, Ok.
Comment from: Chris Joslin [Visitor]
Comment from: Ben Anderson [Visitor]
In step 5 till 13 I used:
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
But will I remember to upgrade to a new version?
Comment from: Alastair [Visitor]
I tried this, both the jar and the http method and I still get the christmas tree effect. Tried cleaning, validating etc etc etc.
If anyone comes across this problem again and finds a solution could you post it up here - I’ll do the same if I can manage this. Two days now :(
Comment from: Shabna [Visitor]
Comment from: Wonsuk Choi [Visitor]
Form is loading...