Does anyone know exactly what javax.jms.InvalidDestinationException: Not allowed to create destination means?

百般思念 提交于 2019-12-02 03:01:35

问题


I am try to connect to a Tibco Ems Topic using Spring when I recieve this error.

Here is the config:

    <jms:listener-container connection-factory="Tcf"    acknowledge="auto" >
    <jms:listener id="ListenerContainer" destination="######" ref="MessageListener" />
</jms:listener-container>

<bean id="MessageListener" class="com.dcc.jms.listeners.TestListener"></bean>


<!-- JNDI Template --> 
<bean id="JndiTemplate" class="org.springframework.jndi.JndiTemplate">
    <property name="environment">
        <props>
            <prop key="java.naming.provider.url">#</prop>
            <prop key="java.naming.factory.url.pkgs">com.sun.jndi.ldap </prop>
            <prop key="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory</prop>
        </props>
    </property>
</bean>

<!-- CONNECTION FACTORY -->
<bean id="Tcf"
    class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
    <property name="username" value="" />
    <property name="password" value="" />
    <property name="targetConnectionFactory">
        <bean class="org.springframework.jndi.JndiObjectFactoryBean">
            <property name="jndiTemplate" ref="JndiTemplate" />
            <property name="jndiName" value="#" />
        </bean>
    </property>
</bean>

What exactly does this mean? Are my details or my config wrong?


回答1:


The JMS specification defines it as

This exception must be thrown when a destination either is not understood by a provider or is no longer valid.

Typically it means that the name of the Destination is invalid, e.g. the parameter passed to

Session.createQueue(String qName)

(edit: or defined in JNDI) does not meet provider naming conventions or does not exist, occasionally it can be used for other reasons (e.g. attempting to use a TemporaryQueue that has been closed off). I'd double-check your config to make sure you've specified the correct name, most likely there's an error in there somewhere and/or you're trying something that doesn't match EMS conventions.




回答2:


I was also looking for the solution for this as I was facing same problem.

There were problem with my EMS environment and My EMS environment doesn't have one topic.

I searched for the answer a lot and below are the steps I got.

Below are the steps:

  1. Start TIBCO EMS Server.

  2. Login to TIBCO EMS Administrator Tool using admin user.

  3. Once connected then run below command to check available topics.

    show topics

  4. You can see that there is no topic available with the name '>'

  5. Create one topic with below command.

    create topic >

  6. Now Try to connect your dynamic topic using your code you should be able to connect to EMS Environment and can create dynamic topic.

May be this can help you too.

Source of the Information: http://aajsearch.com/556/connecting-environment-allowed-destination-anyone-please?show=557#a557




回答3:


It seems like you're referencing a Destination which doesn't exist. That is, a name error. Perhaps the wrong JNDI name prefix? Or using the JNDI name instead of the EMS Queue name? Or vice versa. Sorry, it's been a while since I worked with EMS.




回答4:


Look for the queues.conf file in ems folder under tibco and enable dynamic queue creation using '>'. This solved the error for me.



来源:https://stackoverflow.com/questions/6901043/does-anyone-know-exactly-what-javax-jms-invaliddestinationexception-not-allowed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!