4 Replies Latest reply on Jan 20, 2009 4:37 AM by davidyo

    Issues connecting to Tibco EMS

    davidyo

      I have having problems connecting a MDB to our EMS server I have followed the instructions on the wiki http://www.jboss.org/community/docs/DOC-10053. I am getting the following error.

      2009-01-02 09:39:31,984 DEBUG[org.jboss.resource.adapter.jms.inflow.dlq.AbstractDLQHandler] Got dlq connection factory QueueConnectionFactor [URL=tcp://192.9.215.112:7422,tcp://192.9.208.112:7422;clientID=null from IntQueueConnectionFactory
      2009-01-02 09:39:31,984 DEBUG org.jboss.resource.adapter.jms.inflow.dlq.AbstractDLQHandler] Attempting to create queue connection with user null
      2009-01-02 09:39:35,000 ERROR[org.jboss.resource.adapter.jms.inflow.JmsActivation] Unable to reconnect org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@11258b2(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@16827b5 destination=topic.cogwmp.svcs.shared.addr.> isTopic=true tx=true durable=false
      reconnect=10 provider=java:/TIBCOJMSProvider user=admin pass=<not shown> maxMessages=1 minSession=1 maxSession=15
       keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler
      DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=5)
      javax.jms.JMSSecurityException: Failed to connect to any server at: tcp://192.9.215.112:7422,tcp://1
      92.9.208.112:7422 [Error: invalid name or password: url that returned this exception = TCP://192.9.208.112:7422 ]


      The problem as I see it is this, the configuration in the tibco-jms-ds.xml seems to work fine, it connects, JNDI seems to be fine, the problem is that when the MDB attempts to connect it is not passing the username and password in the connection to the EMS. So consequently the Tibco EMS is saying that the anonymous connection is not authorized, if I allow anonymous connections on the EMS its work fine. But this not something I can do on the production server.

      The MDB is using EJB3 annotations, I saw that there are properties for user and password which I have tried setting but with no luck. Bellow is my ds.xml and MDB code, any help would be greatly appreciated.

      Thanks


      tibco-jms-ds.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <connection-factories>
       <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
      name="org.jboss.jms.jndi:service=JMSProviderLoader,name=TibjmsProvider">
       <attribute name="ProviderName">TIBCOJMSProvider</attribute>
       <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
       <attribute name="FactoryRef">ConnectionFactory</attribute>
       <attribute name="QueueFactoryRef">IntQueueConnectionFactory</attribute>
       <attribute name="TopicFactoryRef">IntTopicConnectionFactory</attribute>
       <attribute name="Properties">
       java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory
       java.naming.factory.url.pkgs=com.tibco.tibjms.naming
       java.naming.provider.url=tcp://ems2:7422
       java.naming.security.principal=admin
       java.naming.security.credentials=password
       </attribute>
       </mbean>
      
       <mbean code="org.jboss.naming.NamingAlias"
       name="DefaultDomain:service=NamingAlias,fromName=ConnectionFactory">
       <attribute name="ToName">tibjmsnaming://ems2/QueueConnectionFactory
       </attribute>
       <attribute name="FromName">ConnectionFactory</attribute>
       </mbean>
      
       <tx-connection-factory>
       <jndi-name>TibcoEMS</jndi-name>
       <rar-name>jms-ra.rar</rar-name>
       <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
       <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Queue</config-property>
       <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/TIBCOJMSProvider</config-property>
       <max-pool-size>20</max-pool-size>
       <security-domain-and-application>TibcoEMSRealm</security-domain-and-application>
      
       <config-property name="UserName" type="java.lang.String">admin</config-property>
       <config-property name="Password" type="java.lang.String">password</config-property>
      
       </tx-connection-factory>
      
       <!-- ==================================================================== -->
      </connection-factories>


      TestMDB.java

      public @MessageDriven(name = "TestMDB", activationConfig = {
       @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
       @ActivationConfigProperty(propertyName = "destination", propertyValue = "topic.cogwmp.svcs.shared.addr.>"),
       @ActivationConfigProperty(propertyName="user",propertyValue="admin"),
       @ActivationConfigProperty(propertyName="password",propertyValue="password"),
       @ActivationConfigProperty(
       propertyName="providerAdapterJNDI",
       propertyValue="java:/TIBCOJMSProvider")
       })
       class TestMDB implements MessageListener {
      
       private static final Log logger = LogFactory.getLog(TestMDB.class);
       public void onMessage(Message arg0) {
       TextMessage txtMsg = (TextMessage)arg0;
      
      
       try {
       logger.info("Msg is "+ txtMsg.getText());
       } catch (JMSException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
       }
      
       }
      
      }





        • 1. Re: Issues connecting to Tibco EMS

           


          2009-01-02 09:39:31,984 DEBUG org.jboss.resource.adapter.jms.inflow.dlq.AbstractDLQHandler] Attempti
          ng to create queue connection with user null


          This is the connection for the DLQ connection.
          You haven't specified the user/password for that see the activation spec properties on the WIKI.

          Alternatively disable the DLQ if tibco already supports them natively.

          • 2. Re: Issues connecting to Tibco EMS
            davidyo

            If i specifiy DLQUser and DLQPassword I get the same thing.

            • 3. Re: Issues connecting to Tibco EMS

              If you specifed them correctly you can't get the same thing.

              It would show the user id in the DEBUG message and also in the error message
              where it shows the ActivationSpec properties.

              Of course, it would still fail if they were invalid like the TIBCO error message says.
              Does it work if you don't configure the DLQ? i.e. useDLQ=false

              • 4. Re: Issues connecting to Tibco EMS
                davidyo

                Thanks alot that worked a treat.

                The only issue I have now is that I have the username and password hard coded in the annotation of the MDB. Does any one know how can I define it in the mBean settings in the tib-ds.xml file? Or where should it be defined to make it configurable?

                Thanks