Announcement Announcement Module
Collapse
No announcement yet.
Spring JMS and Tibco EMS Integration Queue Name not found: 'EHS_ResubmitQueue' Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring JMS and Tibco EMS Integration Queue Name not found: 'EHS_ResubmitQueue'

    Hi,

    I try to send a message from my spring based j2ee appilcation to Tibco - EMS 6x system.
    J2ee application is deployed in Jboss 5x server.

    But when I dpeloyed the application I found exception - javax.naming.NameNotFoundException: Name not found: 'EHS_ResubmitQueue'
    Tibco - EMS Queue configuration is attached
    My Queue name is - EHS_ResubmitQueue


    Attachment

    Spring configuration file as below.

    <!-- JMS Sender Utility service configuration -->

    <bean id="jmsSender" class="com.tibcoEMSConnect.JMSSenderUtilityService ">
    <property name="jmsTemplate" ref="jmsTemplate" />

    </bean>


    <!-- ####################################### -->
    <!-- JMS Spring Beans -->
    <!-- ####################################### -->


    <!-- JNDI Environment Template -->
    <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
    <property name="environment">
    <props>
    <prop key="java.naming.factory.initial">com.tibco.tibjms .naming.TibjmsInitialContextFactory
    </prop>
    <prop key="java.naming.provider.url">tcp://vmesbdev.wiley.com:7222</prop>
    <prop key="java.naming.factory.url.pkgs">com.tibco.tibjm s.naming</prop>
    <prop key="java.naming.security.principal">admin</prop>
    </props>
    </property>
    </bean>


    <!-- JMS Queue Connection Factory -->
    <bean id="internalJmsQueueConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryB ean">
    <property name="jndiTemplate">
    <ref bean="jndiTemplate" />
    </property>
    <property name="jndiName">
    <!-- <value>XAConnectionFactory</value> -->
    <value>QueueConnectionFactory</value>
    </property>
    </bean>



    <!-- JMS Destination -->
    <bean id="destination" class="org.springframework.jndi.JndiObjectFactoryB ean">
    <property name="jndiTemplate">
    <ref bean="jndiTemplate" />
    </property>
    <property name="jndiName">
    <value>EHS_ResubmitQueue</value>
    </property>
    </bean>

    <!-- JMS Queue Template -->
    <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate102 ">

    <property name="connectionFactory" ref="internalJmsQueueConnectionFactory" />
    <property name="defaultDestination" ref="destination" />
    <property name="receiveTimeout" value="300" />

    </bean>


    But when I use simple java class I am able to connect and send the message with below code.

    String serverUrl = "tcp://vmesbdev.wiley.com:7222";
    // String userName = "admin";
    // String password = "";

    String queueName = "EHS_ResubmitQueue";

    String data = "Test By Tintin";

    public tibjmsQueueSender(String[] args) {

    if (queueName == null) {
    System.err.println("Error: must specify queue name");
    }

    System.err.println("Publishing into queue: '" + queueName + "'\n");

    try {
    QueueConnectionFactory factory = new com.tibco.tibjms.TibjmsQueueConnectionFactory(serv erUrl);

    // QueueConnection connection =
    // factory.createQueueConnection(userName, password);
    QueueConnection connection = factory.createQueueConnection();
    QueueSession session = connection.createQueueSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
    javax.jms.Queue queue = session.createQueue(queueName);
    QueueSender sender = session.createSender(queue);
    /* publish messages */
    javax.jms.TextMessage message = session.createTextMessage();
    String text = data;
    message.setText(text);
    sender.send(message);
    System.err.println("Sent message: " + text);
    connection.close();
    } catch (JMSException e) {
    e.printStackTrace();
    System.exit(0);
    }
    }
    Attached Files

  • #2
    Originally posted by shankha View Post
    Hi,

    I try to send a message from my spring based j2ee appilcation to Tibco - EMS 6x system.
    J2ee application is deployed in Jboss 5x server.

    But when I dpeloyed the application I found exception - javax.naming.NameNotFoundException: Name not found: 'EHS_ResubmitQueue'
    Tibco - EMS Queue configuration is attached
    My Queue name is - EHS_ResubmitQueue


    Attachment

    Spring configuration file as below.

    <!-- JMS Sender Utility service configuration -->

    <bean id="jmsSender" class="com.tibcoEMSConnect.JMSSenderUtilityService ">
    <property name="jmsTemplate" ref="jmsTemplate" />

    </bean>


    <!-- ####################################### -->
    <!-- JMS Spring Beans -->
    <!-- ####################################### -->


    <!-- JNDI Environment Template -->
    <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
    <property name="environment">
    <props>
    <prop key="java.naming.factory.initial">com.tibco.tibjms .naming.TibjmsInitialContextFactory
    </prop>
    <prop key="java.naming.provider.url">tcp://vmesbdev.lnt.com:7222</prop>
    <prop key="java.naming.factory.url.pkgs">com.tibco.tibjm s.naming</prop>
    <prop key="java.naming.security.principal">admin</prop>
    </props>
    </property>
    </bean>


    <!-- JMS Queue Connection Factory -->
    <bean id="internalJmsQueueConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryB ean">
    <property name="jndiTemplate">
    <ref bean="jndiTemplate" />
    </property>
    <property name="jndiName">
    <!-- <value>XAConnectionFactory</value> -->
    <value>QueueConnectionFactory</value>
    </property>
    </bean>



    <!-- JMS Destination -->
    <bean id="destination" class="org.springframework.jndi.JndiObjectFactoryB ean">
    <property name="jndiTemplate">
    <ref bean="jndiTemplate" />
    </property>
    <property name="jndiName">
    <value>EHS_ResubmitQueue</value>
    </property>
    </bean>

    <!-- JMS Queue Template -->
    <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate102 ">

    <property name="connectionFactory" ref="internalJmsQueueConnectionFactory" />
    <property name="defaultDestination" ref="destination" />
    <property name="receiveTimeout" value="300" />

    </bean>


    But when I use simple java class I am able to connect and send the message with below code.

    String serverUrl = "tcp://vmesbdev.lnt.com:7222";
    // String userName = "admin";
    // String password = "";

    String queueName = "EHS_ResubmitQueue";

    String data = "Test By Tintin";

    public tibjmsQueueSender(String[] args) {

    if (queueName == null) {
    System.err.println("Error: must specify queue name");
    }

    System.err.println("Publishing into queue: '" + queueName + "'\n");

    try {
    QueueConnectionFactory factory = new com.tibco.tibjms.TibjmsQueueConnectionFactory(serv erUrl);

    // QueueConnection connection =
    // factory.createQueueConnection(userName, password);
    QueueConnection connection = factory.createQueueConnection();
    QueueSession session = connection.createQueueSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
    javax.jms.Queue queue = session.createQueue(queueName);
    QueueSender sender = session.createSender(queue);
    /* publish messages */
    javax.jms.TextMessage message = session.createTextMessage();
    String text = data;
    message.setText(text);
    sender.send(message);
    System.err.println("Sent message: " + text);
    connection.close();
    } catch (JMSException e) {
    e.printStackTrace();
    System.exit(0);
    }
    }

    ================================================== ==================
    SHORT Term solution

    I modified the configuration file and use the default queue from Tibco EMS.


    I changed my custom queue name from "EHS_ResubmitQueue" to default EMS queue - "queue.sample" and running.


    I am not able to understand why ? But message san be send to the both queue with sample java code - as given above.



    <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
    <property name="environment">
    <props>
    <prop key="java.naming.factory.initial">com.tibco.tibjms .naming.TibjmsInitialContextFactory
    </prop>
    <prop key="java.naming.provider.url">tibjmsnaming://vmesbdev.lnt.com:7222</prop>
    </props>
    </property>
    </bean>

    <bean id="jmsConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryB ean">
    <property name="jndiTemplate" ref="jndiTemplate" />
    <property name="jndiName" value="QueueConnectionFactory" />
    </bean>

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

    <bean id="destination" class="org.springframework.jndi.JndiObjectFactoryB ean">
    <property name="jndiTemplate" ref="jndiTemplate" />
    <property name="jndiName" value="queue.sample" />
    </bean>

    <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
    <property name="connectionFactory" ref="jmsConnectionFactory" />
    <property name="destinationResolver" ref="jmsDestinationResolver" />
    <property name="defaultDestination" ref="destination" />
    </bean>
    Attached Files

    Comment


    • #3
      Hi,

      I have problem with the communications between the tail and spring tibco ems 2.0, EMS leaves the messages in the queue but they are not consumed by spring. It's strange because the same queue pass other types of messages and the adapter log (spring) can be seen passing messages. Currently the only way to fix it is to reboot the adapter (spring) and immediately begin to consume messages from the queue of EMS.

      Anyone know what might be happening?

      I appreciate your help,

      Luis Parody

      Comment

      Working...
      X