3 Replies Latest reply on Apr 27, 2006 1:26 AM by steve lau

    JBoss register Weblogic Topic mini-howto

    ftftft Newbie

      My solution is not good enough as a patch, but it works. I post it here and hope someone can make it better.

      1. write a new WeblogicMQProvider.java. Use source code from ./server/src/main/org/jboss/jms/jndi/JBossMQProvider.java. but change the method getInitialContext() to provide weblogic JNDI context parameter

      2. create a weblogic-ds.xml in the deploy/jms. JBossConnectionFactory is the connection factory created in the weblogic server. also, you change ProviderUrl and ProviderAdapterClass as you wish.

      <?xml version="1.0" encoding="UTF-8"?>


      <!-- The Weblogic JMS provider loader -->





      3. write a new JMSContainerInvoker.java. Copy code from /server/src/main/org/jboss/ejb/plugins/jms/JMSContainerInvoker.java. do some modification. This is not complete code. You should modify them a little a bit.

      Replace orginal code with the follow code in innerCreate().

      tsession =
      tConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
      log.debug("Topic Session set up");

      // To be no-durable or durable
      if (config.getSubscriptionDurability() != MessageDrivenMetaData.DURABLE_SUBSCRIPTION)
      // Create non durable
      tsubscriber = tsession.createSubscriber(topic);
      log.debug("Topic Subscriber set up");
      // Durable subscription
      String durableName = config.getSubscriptionId();

      tsubscriber = tsession.createDurableSubscriber(topic,durableName);
      log.debug("Durable Topic Subscriber set up");
      tsubscriber.setMessageListener(new MessageListenerImpl(this));
      log.debug("Topic Subscriber set up its listener");

      Replace orginal code with the follow code in innerStop().

      if ( tsession != null )
      MessageDrivenMetaData config =
      if (config.getSubscriptionDurability() == MessageDrivenMetaData.DURABLE_SUBSCRIPTION) {
      // Get configuration information - from EJB-xml
      String durableName = config.getSubscriptionId();

      4. jboss.xml

      <ejb-name>blah blah</ejb-name>
      ~~~~~~~~~~ JNDI name in weblogic server
      <!-- the follow three lines is important-->
      ... ....




      <!-- CMT -->
      <!-- BMT -->
      <persistence-manager></persistence-manager> <container-pool-conf>
      100 </container-pool-conf>

      5. package the two java class. copy it and weblogic.jar into server/default/lib. I don't know why wlclient.jar doesn't work.

      Andira, I'm sorry that I don't have enough time to polish it better.


        • 1. Re: JBoss register Weblogic Topic mini-howto
          maxi72 Newbie

          Thanks, where i find the source :
          ./server/src/main/org/jboss/jms/jndi/JBossMQProvider.java and

          i'm using Jboss 3.2.3, and i will connect jboss MDB to queue on weblogic server.

          • 2. Re: JBoss register Weblogic Topic mini-howto
            ftftft Newbie

            Download JBoss source code. You will find it.

            "maxi72" wrote:
            Thanks, where i find the source :
            ./server/src/main/org/jboss/jms/jndi/JBossMQProvider.java and

            i'm using Jboss 3.2.3, and i will connect jboss MDB to queue on weblogic server.

            • 3. Re: JBoss register Weblogic Topic mini-howto
              steve lau Newbie

              Hi, would like to ask I tried to follow the rules but it fails.
              I digged into it, found that weblogic doesn't allow remote call to create ConnectionConsumer which JMSContainerInvoker (a jboss class) would try to do. It throws with such a root exception:

              Caused by: weblogic.jms.common.IllegalStateException: connection consumer only supported on server
              at weblogic.jms.client.JMSConnection.createConnectionConsumer(JMSConnection.java:744)
              at weblogic.jms.client.JMSConnection.createConnectionConsumer(JMSConnection.java:479)
              at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerStartDelivery(JMSContainerInvoker.java:890)
              ... 155 more

              Which weblogic server you use and how do you solve the problem ?? I am currently using jboss 4.0.3 sp1 and weblogic 8.1 sp3

              I searched the bea forums & bea docs and found that someone stated ConnecctionConsumer cannot be initialized out of weblogic server. I decompiled the weblogic code and found that it checked the Kernel.isServer(), and I tried to cheat the weblogic server to set the KernelStatus.setIsServer(true), it throws something else too about serializing stuff which seems not a possible way to solve.

              Is there anyone who have some successful experience to share? Really appreciate your helps & thanks so much!!!!