【问题标题】:Spring 3 ActiveMQ Error - AMQ Tag Not RecognizedSpring 3 ActiveMQ 错误 - 无法识别 AMQ 标记
【发布时间】:2015-01-13 18:38:53
【问题描述】:

说明: 基于下面列出的其他类似问题,我的 Spring 文件中似乎存在命名空间问题或错误链接来生成此错误。我测试了每个链接,但每个链接似乎都有效。寻找我可能缺少的想法和建议É

Spring 文件中的错误: cvc-complex-type.2.4.c:匹配通配符是严格的,但找不到元素'amq:connectionFactory'的声明

类似问题: StackoverFlow Posting

弹簧配置文件:

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

【问题讨论】:

  • 嗨 Haju,您能否确认 Eclipse 正在报告此错误?
  • 它在 RAD 7.5 中给出了这个错误。我相信它是基于 Eclipe 3.6 构建的。我想我将不得不删除 AMQ 引用,只创建引用 AMQ 类的通用 bean。
  • 我能够在我使用的 Eclipse 3.6 实例中验证您的 XML,并且没有错误。您是否在代理后面,您的 RAD 实例是否为代理配置?
  • 是的,你是对的 Sully,我在代理服务器上的密码已于 3 天前过期,并且我没有在 RAD 内重置。如果您想将其放入答案框中,我会将其标记为正确。吸取教训,在家中测试,而不仅仅是在工作中。

标签: spring activemq


【解决方案1】:

我也遇到了同样的问题,尝试了命名空间声明的顺序,终于解决了。

【讨论】:

    【解决方案2】:

    上面cmets中Sully6768提供的答案:

    上面的代码没有问题。

    由开发工作区中的配置设置引起的问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-11-19
      • 1970-01-01
      • 2015-12-26
      • 2017-02-11
      • 2012-07-29
      • 2015-11-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多