问题描述
有人知道如何将 activemq-core.xsd url与jar文件(activemq-core-5.2.0.jar)中的 activemq.xsd 关联。 ?
Somebody knows how to associate the activemq-core.xsd url with the activemq.xsd found in the jar file (activemq-core-5.2.0.jar)?
我在互联网上挖掘了一些解决方案,但是没有用。
I dig some solution in internet but didn't work.
我遇到了这个错误:
Caused by: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 19 in XML document from class path resource [jms-context.xml] is invalid; nested exception is 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'.
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:81)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:42)
at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:173)
at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:197)
这让我很惊讶,因为我们从schemaLocation ( classpath:activemq.xsd),我们正在使用本地语言。但是我不知道为什么XML在构建过程中没有找到activemq.xsd。我在类路径中添加了JAR文件,应该不会那样工作?
This shoud me hapening because we remove the URL from the schemaLocation (http://activemq.apache.org/schema/core classpath:activemq.xsd), and we are using localy. But I don't know why XML are not finding the activemq.xsd during the build process. I add the JAR file in the classpath, should not work like that??
在此先感谢您的帮助
推荐答案
您看到这个问题了吗?
(我自己的问题,然后是我的解决方案)
Did you see this question?Tomcat understands amq:broker but Eclipse marks errors in schema(my own question, followed up with my solution)
我认为这与您遇到的问题相同。将这些条目添加到XML Catalog之后,我能够对其进行修复。
I think that's the same problem you are having. I was able to fix it after adding those entries to the XML Catalog.
这篇关于如何将activemq-core.xsd url与jar文件中找到的activemq.xsd关联?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!