Note that there are some explanatory texts on larger screens.

plurals
  1. POJMS error: can not send into foreign destinations
    text
    copied!<p>I use Spring-configured jms template with tibco jms library. I get jms connection factory and topic with JNDI and these objects are not null. But when I try to send message or add listener I get this exception:</p> <p>For listener:</p> <pre><code>Exception in thread "main" org.springframework.jms.InvalidDestinationException: Can not send into foreign destinations; nested exception is javax.jms.InvalidDestinationException: Can not send into foreign destinations at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:277) at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:168) at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:474) at org.springframework.jms.core.JmsTemplate.receiveSelected(JmsTemplate.java:700) at org.springframework.jms.core.JmsTemplate.receive(JmsTemplate.java:682) at org.springframework.jms.core.JmsTemplate.receive(JmsTemplate.java:674) </code></pre> <p>For sender:</p> <pre><code>Exception in thread "main" org.springframework.jms.InvalidDestinationException: Invalid or foreigndestination; nested exception is javax.jms.InvalidDestinationException: Invalid or foreigndestination at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:277) at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:168) at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:474) at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:539) at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:531) </code></pre> <p>Client app is working with the same topic without problems (so jms server is running). Do you have any ideas? I read about this exception in javadoc, but can't find how to understand the root issue and fix it. Thanks</p> <p>UPD: JMS-related part of config:</p> <pre><code>&lt;bean id="JmsFactory" class="org.springframework.jndi.JndiObjectFactoryBean"&gt; &lt;property name="jndiName" value="${jms.factory}"/&gt; &lt;property name="proxyInterface" value="javax.jms.TopicConnectionFactory" /&gt; &lt;property name="lookupOnStartup" value="false" /&gt; &lt;property name="jndiEnvironment"&gt; &lt;props&gt; &lt;prop key="java.naming.provider.url"&gt;${jms.namingProvider}&lt;/prop&gt; &lt;prop key="java.naming.factory.initial"&gt;${jms.namingFactory}&lt;/prop&gt; &lt;prop key="java.naming.referral"&gt;${jms.namingReferral}&lt;/prop&gt; &lt;prop key="java.naming.security.credentials"&gt;${jms.securityCredentials}&lt;/prop&gt; &lt;prop key="java.naming.security.principal"&gt;${jms.securityPrincipal}&lt;/prop&gt; &lt;/props&gt; &lt;/property&gt; &lt;/bean&gt; &lt;bean id="JmsTopic" class="org.springframework.jndi.JndiObjectFactoryBean"&gt; &lt;property name="jndiName" value="${jms.topic}"/&gt; &lt;property name="proxyInterface" value="javax.jms.Topic" /&gt; &lt;property name="lookupOnStartup" value="false" /&gt; &lt;property name="jndiEnvironment"&gt; &lt;props&gt; &lt;prop key="java.naming.provider.url"&gt;${jms.namingProvider}&lt;/prop&gt; &lt;prop key="java.naming.factory.initial"&gt;${jms.namingFactory}&lt;/prop&gt; &lt;prop key="java.naming.referral"&gt;${jms.namingReferral}&lt;/prop&gt; &lt;prop key="java.naming.security.credentials"&gt;${jms.securityCredentials}&lt;/prop&gt; &lt;prop key="java.naming.security.principal"&gt;${jms.securityPrincipal}&lt;/prop&gt; &lt;/props&gt; &lt;/property&gt; &lt;/bean&gt; &lt;bean id="UserCredentialsConnectionFactory" class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter"&gt; &lt;property name="targetConnectionFactory"&gt; &lt;ref bean="JmsFactory" /&gt; &lt;/property&gt; &lt;property name="username" value="${jms.user}" /&gt; &lt;property name="password" value="${jms.password}" /&gt; &lt;/bean&gt; &lt;bean id="JmsTemplate" class="org.springframework.jms.core.JmsTemplate"&gt; &lt;property name="connectionFactory" ref="UserCredentialsConnectionFactory" /&gt; &lt;property name="defaultDestination"&gt; &lt;ref bean="JmsTopic"/&gt; &lt;/property&gt; &lt;property name="pubSubDomain" value="true" /&gt; &lt;/bean&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload