Java 创建名为“inboundJms.container”的bean时出错:无法解析对bean“connectionFactory”的引用
我试图在Spring集成的帮助下侦听weblogic队列。获取以下异常 org.springframework.beans.factory.BeanCreationException:创建名为“inboundJms.container”的bean时出错:设置bean属性“connectionFactory”时无法解析对bean“connectionFactory”的引用;嵌套的异常是org.springframework.beans.factory.NoSuchBeanDefinitionException:没有名为“connectionFactory”的bean可用 Config.xmlJava 创建名为“inboundJms.container”的bean时出错:无法解析对bean“connectionFactory”的引用,java,weblogic,spring-integration,Java,Weblogic,Spring Integration,我试图在Spring集成的帮助下侦听weblogic队列。获取以下异常 org.springframework.beans.factory.BeanCreationException:创建名为“inboundJms.container”的bean时出错:设置bean属性“connectionFactory”时无法解析对bean“connectionFactory”的引用;嵌套的异常是org.springframework.beans.factory.NoSuchBeanDefinitionExc
<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"/>
默认情况下,需要ConnectionFactory的spring集成JMS组件将查找名为“ConnectionFactory”的bean,该bean指向ConnectionFactory实现。另一方面,您有一个名为“wlConnectionFactory”的ConnectionFactorybean。因此,要么将其名称更改为“connectionFactory”,要么在“消息驱动通道适配器”上定义“connectionFactory”属性
干杯谢谢,我明白了