Spring 3.0 messageListener on weblogic 10.3 - ERROR “Cause: [JMSClientExceptions:055142]Foreign destination”

By : alanl
Source: Stackoverflow.com
Question!

I am trying to deploy a Spring 3.0.5 messageListener on weblogic 10.3 inside a war, and cannot get it working.

I have create a simple jms quque on weblogic, but it looks like weblogic thinks I am trying to connect as a foreign client, even though everything is local?

[WARN] Setup of JMS message listener invoker failed for destination 'System Module!Test Queue' - trying to recover. Cause: [JMSClientExceptions:055142]Foreign destination, System Module!Test Queue

Here's my spring xml

   <!--  connection factory -->
    <jee:jndi-lookup id="jmsConnectionFactory"  jndi-name="weblogic.jms.ConnectionFactory" 
   expose-access-context="true" />

    <!--  weblogic jms queue -->    
    <jee:jndi-lookup id="testQueue" jndi-name="jms.testQueue" expose-access-context="true"/>

    <!--  my onMessage listener bean -->    
    <bean id="jobNotificationQueueListener" class="com.xxx.component.jms.JobNotificationQueueListener" />

    <!--  spring container -->
    <bean id="jobNotificationQueueContainer"
    class="org.springframework.jms.listener.DefaultMessageListenerContainer">
        <property name="connectionFactory" ref="jmsConnectionFactory" />
        <property name="destination" ref="testQueue" />
        <property name="messageListener" ref="jobNotificationQueueListener" />
        <property name="sessionAcknowledgeModeName" value="AUTO_ACKNOWLEDGE" />
        <property name="sessionTransacted" value="true" />
    </bean>

Anybody seen this before?

By : alanl


Answers

Foreign JMS requires their client library (i.e. Websphere MQ would require mq.jar and two more) in the classpath, then connection factory class should be configured (otherwise default Weblogic will be used) and so on.

In other words, this is likely a configuration issue, not programming.



This error message does not indicate that you are trying to connect as a 'foreign client'. WebLogic thinks that you are trying to connect to a Foreign Destination, which is different.

What type of queue are you trying to set up? Some things to try: 1) Try browsing the JNDI tree to the destination to confirm its there and confirm the type is correct 2) Confirm that you have JMS servers created and targeted to the server in question 3) Confirm that you have the targeting correct for the queue

UPDATE: I was able to reproduce and solve this problem. In my ApplicationContext file I used to have this configuration:

  
By : Jeff West


This video can help you solving your question :)
By: admin