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?

      http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3939722#3939722
      http://www.jboss.org/index.html?module=bb&op=viewtopic&t=48453&
      http://www.jboss.com/index.html?module=bb&op=viewtopic&t=48463
      http://www.jboss.com/index.html?module=bb&op=viewtopic&t=41311
      http://forums.bea.com/bea/thread.jspa?messageID=600005273&tstart=0

      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
          http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3939722#3939722
          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.


          WLJMSProvider
          org.jboss.jms.jndi.JNDIProviderAdapter
          TestConnectionFactory
          TestConnectionFactory

          java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
          java.naming.provider.url=t3://localhost:14001



          ** Then edited the jboss_home/server/default/conf/standardjboss.xml
          <invoker-proxy-binding>
          wl-mdb-invoker
          <invoker-mbean>default</invoker-mbean>
          <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory>
          <proxy-factory-config>
          WLJMSProvider
          StdJMSPool
          1
          30000
          15
          1

          10

          queue/DLQ
          10
          0


          </proxy-factory-config>
          </invoker-proxy-binding>

          <container-configuration>
          <container-name>Weblogic Remote Message Driven Bean</container-name>
          <call-logging>false</call-logging>
          <invoker-proxy-binding-name>wl-mdb-invoker</invoker-proxy-binding-name>
          <container-interceptors>
          org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor
          org.jboss.ejb.plugins.LogInterceptor
          org.jboss.ejb.plugins.RunAsSecurityInterceptor
          <!-- CMT -->
          org.jboss.ejb.plugins.TxInterceptorCMT
          org.jboss.ejb.plugins.CallValidationInterceptor
          org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor
          <!-- BMT -->
          org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor
          org.jboss.ejb.plugins.MessageDrivenTxInterceptorBMT
          org.jboss.ejb.plugins.CallValidationInterceptor
          org.jboss.resource.connectionmanager.CachedConnectionInterceptor
          </container-interceptors>
          <instance-pool>org.jboss.ejb.plugins.MessageDrivenInstancePool</instance-pool>
          <instance-cache></instance-cache>
          <persistence-manager></persistence-manager>
          <container-pool-conf>
          100
          </container-pool-conf>
          </container-configuration>


          ** and in my mdb jboss.xml

          <enterprise-beans>
          <message-driven>
          <ejb-name>Mdb1</ejb-name>
          <destination-jndi-name>TestQueue1</destination-jndi-name>
          <!--destination-jndi-name>queue/testQueue</destination-jndi-name-->
          <invoker-bindings>

          <invoker-proxy-binding-name>wl-mdb-invoker</invoker-proxy-binding-name>
          <!--invoker-proxy-binding-name>mymessage-driven-bean</invoker-proxy-binding-name-->

          </invoker-bindings>
          </message-driven>
          </enterprise-beans>



          ** 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
            http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/jms/ConnectionConsumer.html
            "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.

                http://forums.bea.com/bea/message.jspa?messageID=600034859&tstart=0

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

                  Hi,

                  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.

                  Thanks
                  Sri