创建名称为 'inboundJms.container' 的 bean 时出错:无法解析对 bean 'connectionFactory' 的引用

Error creating bean with name 'inboundJms.container': Cannot resolve reference to bean 'connectionFactory'

我正在尝试在 Spring integration.getting 异常

下方的帮助下侦听 weblogic 队列

org.springframework.beans.factory.BeanCreationException:创建名称为 'inboundJms.container' 的 bean 时出错:设置 bean 属性 'connectionFactory' 时无法解析对 bean 'connectionFactory' 的引用;嵌套异常是 org.springframework.beans.factory.NoSuchBeanDefinitionException:没有名为 'connectionFactory' 的 bean 可用

Config.xml

<bean id="wljndiTemplate" class="org.springframework.jndi.JndiTemplate" lazy-init="true">
        <property name="environment">
            <props>
                <prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop>
                <prop key="java.naming.provider.url">-------</prop>
                <prop key="java.naming.security.principal">-------</prop>
                <prop key="java.naming.security.credentials">-------</prop>
            </props>
        </property>
    </bean>

    <bean id="wlConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiTemplate" ref="wljndiTemplate" />
        <property name="jndiName" value="QueueConnFactory" />
    </bean>

    <bean id="wlDestinationResolver"  class="org.springframework.jms.support.destination.JndiDestinationResolver">
        <property name="jndiTemplate" ref="wljndiTemplate" />
        <property name="cache" value="true" />
    </bean>

    <bean id="inboundResponseQueue" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiTemplate" ref="wljndiTemplate" />
        <property name="jndiName" value="OutboundQueue" />

InboundAdapter.xml

<jms:message-driven-channel-adapter id="inboundJms" destination="ContactOutboundQueue" channel="messageReceiver" />

    <!--<router id="msgRouter" auto-startup="true" input-channel="messageReceiver"  default-output-channel=""       ref="routeInfo"         method="getQueueMessage"/>-->

    <integration:service-activator id="msgRouter" input-channel="messageReceiver" ref="routeInfo" method="getQueueMessage"/>

默认情况下 spring 需要 ConnectionFactory 的集成 JMS 组件将查找名为 'connectionFactory' 的指向 ConnectionFactory 实现的 bean。另一方面,您在名称 'wlConnectionFactory' 下有一个 ConnectionFactory bean。因此,要么将其名称更改为 'connectionFactory',要么在 'message-driven-channel-adapter'.

上定义一个 'connection-factory' 属性

干杯