5 Replies Latest reply on Dec 17, 2007 12:23 PM by S Divi

    Connecting jboss (bean, mdb, etc) to remote weblogic jms que

    steve lau Newbie

      Hi Folks,

      I am using jboss 4.0.3 sp1 and weblogic 8.1 sp3, I need to write a program hosted on jboss to retrieve message from a remote queue hosted in weblogic server.

      any of you have experience of that to share?


      I firstly tried those previous post suggested while cannot make it work... found there are so many people who came across this situation before, I will keep on posting what I did try and the result so one day it would be something people can refer.

      Any hints or helps are greatly appreciate T__T
      Thanks so much...

        • 1. Re: Connecting jboss (bean, mdb, etc) to remote weblogic jms
          steve lau Newbie

          The first solution I tried is to host a mdb on jboss to connect to weblogic.
          There is a successful case posted in jboss wiki
          How stupid I am, just can't make it work after followed and it is a post 2 years ago so I don't expect people would answer there.

          ** First thing I do is to config a remote JMS provider in jboss. Edited the jboss_home/server/default/deploy/jms/jms-ds.xml and inlcuded the following there.



          ** Then edited the jboss_home/server/default/conf/standardjboss.xml




          <container-name>Weblogic Remote Message Driven Bean</container-name>
          <!-- CMT -->
          <!-- BMT -->

          ** and in my mdb jboss.xml




          ** And the result, it failed with the following exception
          13:59:46,421 WARN [JMSContainerInvoker] JMS provider failure detected:
          org.jboss.deployment.DeploymentException: Error during queue setup; - nested throwable: (weblogic.jms.common.IllegalStateException: connection consume
          r only supported on server)
          at org.jboss.deployment.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:39)
          at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerStartDelivery(JMSContainerInvoker.java:907)
          at org.jboss.ejb.plugins.jms.JMSContainerInvoker.startService(JMSContainerInvoker.java:933)
          at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:274)
          at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:230)
          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:891)
          ... 155 more

          According to the folks in weblogic forum said ConnectionConsumer can only run in weblogic server. I tried to modify the JMSContainerInvoker and skipped all the ConnectionConsumer. I see the the MDB can connect to the weblogic as I added some printout for the "event" param in the JMSContainerInvoker.sendNotification
          ** org.jboss.ejb.plugins.jms.CONNECTING
          ** org.jboss.ejb.plugins.jms.CONNECTED

          I do a netstat -a | grep 14001 and see an pair of additional connection is connecting of my 14001 weblogic port.
          and when I close the weblogic instance. the Jboss would throw
          weblogic.jms.common.LostServerException: weblogic.rjvm.PeerGoneException: ; nested exception is:
          weblogic.utils.net.SocketResetException - with nested exception:
          [java.net.SocketException: Connection reset]
          at weblogic.jms.client.JMSConnection.jmsPeerGone(JMSConnection.java:917)
          at weblogic.jms.dispatcher.DispatcherWrapperState.peerGone(DispatcherWrapperState.java:703)
          at weblogic.jms.dispatcher.DispatcherWrapperState.callback(DispatcherWrapperState.java:562)
          at weblogic.rjvm.RJVMImpl$HeartbeatMonitorListenerDeliverer.execute(RJVMImpl.java:1554)
          at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
          at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)

          and the JMSContainerInvoker would sendNotification with event
          ** org.jboss.ejb.plugins.jms.DISCONNECTING

          and jboss keeps on reconnecting, but fail with exception
          Caused by: java.net.ConnectException: t3://localhost:14001: Destination unreachable; nested exception is:
          java.net.ConnectException: Connection refused: connect; No available router to destination

          so I assumed the jboss & weblogic connectivity is established with the update the JMSContainerInvoker by commenting out all the ConnectionConsumer code.

          • 2. Re: Connecting jboss (bean, mdb, etc) to remote weblogic jms
            steve lau Newbie

            However, though it seems connecting, the mdb never receive any Message when I published the msg to the queue in weblogic. The mdb is coded correct ly and it works when I connect to the local jboss queue.

            According to the javadoc of ConnectionConsumer
            "For application servers, Connection objects provide a special facility for creating a ConnectionConsumer (optional). The messages it is to consume are specified by a Destination and a message selector. In addition, a ConnectionConsumer must be given a ServerSessionPool to use for processing its messages."

            So after I skipped the ConnectionConsumer, though it seems it can connect to the weblogic server, but it wont get start to process the message there. But if I keep it, the weblogic library throws like the previous posted I provided. One thing I forget to state is I include the weblogic.jar in jboss_home/server/default/lib. I tried with those wl client jar before but fail . Only the weblogic.jar can give such a result.

            Is there anyone can give a hint ? or share any alternative solution to solve teh scenario?

            The possible solution that I haven't tried yet:
            1. Create a message bridge in weblogic, and propagate the msg from weblogic queue to jboss queue, and mdb just subscribed the local queue.
            2. Write a session bean on jboss which uses the jms api to initiate the weblogic initial context and subscribe the weblogic remote queue directly. Would there be any threading issue (or etc) to consider (or potential problem) ?

            • 3. Re: Connecting jboss (bean, mdb, etc) to remote weblogic jms
              Rick Carragher Newbie

              We've been using the WebLogic bridge, with some success. The only recommendation is to use as few of them as possible (i.e. use a limited number of destinations), because WebLogic seems to fall over when the number of destinations gets above 30 or so.

              • 4. Re: Connecting jboss (bean, mdb, etc) to remote weblogic jms
                steve lau Newbie

                Thx rcarragher.
                that's my ultimate solution of the scenario after a lot of test, by setting a bridge on weblogic server and create a remote destination pointing to the queue on jboss which automatically propagate the message to the queue on jboss and let my jboss's mdb subscribe the local queue.

                in case somebody would like to refer the steps with similar scenario as mine, here is the post I raised in bea weblogic so people can get the thing right away.


                • 5. Re: Connecting jboss (bean, mdb, etc) to remote weblogic jms
                  S Divi Newbie


                  I'm trying to do something similar. From JBoss app 4.2.2, Need to consume messages from a remote Topic hosted on Weblogic server 8.1 sp3

                  Any help on how to do this is appreciated.