1 Reply Latest reply on Oct 4, 2006 10:30 AM by romanchr

    Tibco EMS messaging integration fails

    romanchr Newbie

      Hi all,

      I try to set up an environment where I have JBoss 4.0.4GA Patch1 with EJB3.0RC9 and Tibco EMS 4.2.
      In JBOss I would like to run an MDB and EMS the queues for my messaging.
      I followed the configuration guide lines stated here:http://wiki.jboss.org/wiki/Wiki.jsp?page=IntegrationWithTibcoEMS

      I managed to apply all config changes but as you probably can imagine some problems came along.

      Before I explain the problems let me state the bean and the important configurations.
      MDB:

      @MessageDriven(
       activationConfig={
       @ActivationConfigProperty(
       propertyName="destinationType",
       propertyValue="javax.jms.Queue"),
       @ActivationConfigProperty(
       propertyName="destination" propertyValue="gameserver.sender.queue"),
       @ActivationConfigProperty(
       propertyName="providerAdapterJNDI",
       propertyValue="java:/TibcoJMSProvider"),
       @ActivationConfigProperty(
       propertyName="maxPoolSize",
       propertyValue="1"),
       @ActivationConfigProperty(
       propertyName="useDLQ",
       propertyValue="false")})
      public class MessageDispatcher extends ReceiverProxy implements MessageListener
      {
       private static final Logger logger = Logger.getLogger(MessageDispatcher.class);
       public MessageDispatcher(Object arg)
       {
       super(arg);
       }
      
       @Override
       public void onMessage(Message arg0)
       {
       // do stuff
       [...]
       }
      
      
      }
      


      In jboss-service.xml I added a JMSProvider and an alias as described on the wiki:
      <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
       name=":service=JMSProviderLoader,name=TibcoJMSProvider">
       <attribute name="ProviderName">TIBCOJMSProvider</attribute>
       <attribute name="ProviderAdapterClass">
       com.tibco.tibjms.appserver.jboss.JBossAdapter
       </attribute>
       <!-- The queue connection factory -->
       <attribute name="QueueFactoryRef">XAQueueConnectionFactory</attribute>
       <!-- The topic factory -->
       <attribute name="TopicFactoryRef">XATopicConnectionFactory</attribute>
       <!-- Access JMS via JNDI to tibco -->
       <attribute name="Properties">
       java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory
       java.naming.provider.url=tibjmsnaming://localhost:7222
       </attribute>
       </mbean>
      
       <mbean code="org.jboss.naming.NamingAlias"
       name="DefaultDomain:service=NamingAlias,fromName=QueueConnectionFactory">
       <attribute name="ToName">tibjmsnaming://localhost/XAQueueConnectionFactory</attribute>
       <attribute name="FromName">QueueConnectionFactory</attribute>
       </mbean>
      

      In
      standardjboss.xml
      I replaced the following lines:
      <JMSProviderAdapterJNDI>TIBCOJMSProvider</JMSProviderAdapterJNDI>
      

      and
      <DestinationQueue>tibjmsnaming://localhost/queue/DLQ</DestinationQueue>
      


      Last step is to enhance the jndi.properties:
      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces:com.tibco.tibjms.naming
      


      I deployed the bean and started JBoss (EMS is running of course). Checking the boot.log I could not find any errors. How ever in our standard log file I found the following exception:
      [org.jboss.system.ServiceController] Problem starting service DefaultDomain:service=NamingAlias,fromName=QueueConnectionFactory
      javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]
       at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1317)
       at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1446)
       at org.jnp.interfaces.NamingContext.rebind(NamingContext.java:484)
       at org.jnp.interfaces.NamingContext.rebind(NamingContext.java:477)
       at javax.naming.InitialContext.rebind(InitialContext.java:367)
       at org.jboss.util.naming.Util.createLinkRef(Util.java:279)
       at org.jboss.util.naming.Util.createLinkRef(Util.java:246)
       at org.jboss.naming.NamingAlias.createLinkRef(NamingAlias.java:133)
       at org.jboss.naming.NamingAlias.startService(NamingAlias.java:122)
      [...]
      


      After some googeling and checking this forum I found a solution for this problem. I had to add the following line to the
      jndi.properties
      file:
      jnp.disableDiscovery=true
      


      Restarting JBoss and checking the log files again I learned that my original problem is solved but there was a new exception:

      2006-09-28 13:23:14,347 WARN [org.jboss.system.ServiceController] Problem starting service DefaultDomain:service=NamingAlias,fromName=QueueConnectionFactory
      javax.naming.ConfigurationException: No valid Context.PROVIDER_URL was found
       at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1449)
       at org.jnp.interfaces.NamingContext.rebind(NamingContext.java:484)
       at org.jnp.interfaces.NamingContext.rebind(NamingContext.java:477)
       at javax.naming.InitialContext.rebind(InitialContext.java:367)
       at org.jboss.util.naming.Util.createLinkRef(Util.java:279)
       at org.jboss.util.naming.Util.createLinkRef(Util.java:246)
       at org.jboss.naming.NamingAlias.createLinkRef(NamingAlias.java:133)
       at org.jboss.naming.NamingAlias.startService(NamingAlias.java:122)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [...]
      


      I googled and searched a bit more but this time I could not find a solution. I only found out that other users expierence similar problems (always in conjuction with an external system call).
      I see to possible explanations for this exception:

      1. I just missed some really simple config settings
      2. There is a bug in JBoss

      Any help is greatly appreciated!

      Regards

      Christoph

        • 1. Re: Tibco EMS messaging integration fails
          romanchr Newbie

          Hi all,

          I could solve my problems. Originally it seemed to be just one problem but infact there was another onbe coming up after solving the first one (Message "No valid Context.Provider_Url found".
          Here is what I came up with:
          First problem was that NamingAliases are not working when you try to alias a remote object. Therefore I skipped the alias. We came up with another solution. As stated between the lines I do not think the problem with the NamingAlias has anything to do with Tibco. It just doesn't work when a remote lookup is involved.
          The next problem I came across was connected to the class JBossAdapter provided by Tibco. It had some problems setting up the initial context. Instead of using this class I wrote my own Adapter taking care of the context setup.
          Now my MDB was able to retreive messages and all is running fine.

          Regards

          Christoph