描述: 基于下面列出的其他类似问题,我的 Spring 文件中似乎存在命名空间问题或错误链接以生成此错误。我测试了每个链接,但每个链接似乎都有效。寻找我可能错过的想法和建议É
Spring文件中的错误: cvc-complex-type.2.4.c:匹配的通配符是严格的,但找不到元素'amq:connectionFactory'的声明
类似问题: StackoverFlow 发布
弹簧配置文件:
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jms="http://www.springframework.org/schema/jms"
xmlns:amq="http://activemq.apache.org/schema/core"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/jms
http://www.springframework.org/schema/jms/spring-jms.xsd
http://activemq.apache.org/schema/core
http://activemq.apache.org/schema/core/activemq-core-5.6.0.xsd">
<amq:connectionFactory id="connectionFactory" brokerURL="tcp://localhost:61616" />
<amq:queue id="topic" physicalName="spitter.alert.topic" />
<!-- *****JMS TEMPLATE**** -->
<bean id="jmsTemplate"
class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="connectionFactory"/>
<property name="defaultDestinationName" value="spittle.alert.topic"/>
</bean>
<bean id="spittleHandler" class="com.habuma.spitter.alerts.SpittleAlertHandler" />
<jms:listener-container connection-factory="connectionFactory">
<jms:listener destination="spitter.alert.topic" ref="spittleHandler"
method="processSpittle" />
</jms:listener-container>
</beans>