2010-02-18 7 views
5

Quando si lavora con ActiveMQ in Eclipse, si potrebbe a volte ottenere un errore di analisi dello schema in quanto tale:Tomcat capisce amq: mediatore ma Eclipse segna errori di schema

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

Tuttavia, il progetto distribuisce con successo in Tomcat.

risposta

7

Per risolvere questo problema, è necessario associare l'URL ActiveMQ XSD con lo schema.

Passare a XML-> Catalogo XML in Preferenze e aggiungere una voce specificata dall'utente.

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

quindi aggiungere un secondo:

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.

Se avete questo stesso errore e Tomcat non riesce, aprire il file applicationContext-jms.xml che innesca l'errore e sostituire:

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

con

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

risposta ottenuta da http: // www.bigsoft.co.uk/blog/index.php/2009/02/01/invalid-activemq-schema-name-space comments. Vedi la sua soluzione, che usa jar locale, se questo non funziona per te. Ho risposto alla mia domanda. –