3 Replies Latest reply on May 3, 2004 6:51 AM by hama

    Send message from weblogic to JBoss

    pepgrifell

      Hi,

      I´m trying to send a message from Weblogic Server 8.1 to Jboss 3.2.3 but I can´t. I´m newbie in weblogic.

      I have defined a Foreign JMS Server in Weblogic with the parameters :

      JNDI Initial Context Factory = org.jnp.interfaces.NamingContextFactory
      JNDI Connection URL = jnp://192.134.22.169:1099

      I have put as well the parameter java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

      Then I have defined a Foreign JMS Connection Factory with the parameters :

      Local JNDI Name = ConnectionFactory
      Remote JNDI Name = ConnectionFactory // ConnectionFactory in JBoss

      And a Foreign JMS Destination with the parameters :

      Local JNDI Name = QNO.0001.L
      Remote JNDI Name = queue/QNO.0001.L //queue created in JBoss

      With the following code I should do a lookup to the JBoss queue :


      InitialContext iniCtx = new InitialContext();
      QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory)iniCtx.lookup("ConnectionFactory");
       queueConnectionFactory.createQueueConnection();
      Queue queue = (Queue) iniCtx.lookup("QNO.0001.L");
      


      but weblogic server throws this exception :


      ERROR [ExecuteThread: '12' for queue: 'weblogic.kernel.Default'] (?:?) - Error in sendMessage(1)
      org.jboss.mq.SpyJMSException: Cannot send a message to the JMS server; - nested throwable: (java.io.IOException: Class not found for unknown destination.)
      at org.jboss.mq.Connection.sendToServer(Connection.java:1251)
      at org.jboss.mq.SpySession.sendMessage(SpySession.java:732)
      at org.jboss.mq.SpyQueueSender.internalSend(SpyQueueSender.java:118)
      at org.jboss.mq.SpyQueueSender.send(SpyQueueSender.java:68)
      at com.gft.mn.ejb.operation.Operation.sendMessage(Unknown Source)
      at com.gft.mn.ejb.operation.OperationBeanAsync.processMessage(Unknown Source)
      at com.gft.mn.ejb.operation.OperationBeanAsync_ytkq9e_ELOImpl.processMessage(OperationBeanAsync_ytkq9e_ELOImpl.java:4
      at com.gft.mn.ejb.controller.ControllerBean.processMessage(Unknown Source)
      at com.gft.mn.ejb.controller.ControllerBean_ed0lig_ELOImpl.processMessage(ControllerBean_ed0lig_ELOImpl.java:45)
      at com.gft.mn.ejb.mdb.MDBean.onMessage(Unknown Source)
      at weblogic.ejb20.internal.MDListener.execute(MDListener.java:382)
      at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
      at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
      at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
      at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
      at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
      at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
      Caused by: java.io.IOException: Class not found for unknown destination.
      at org.jboss.mq.SpyDestination.readDest(SpyDestination.java:112)
      at org.jboss.mq.SpyMessage.readExternal(SpyMessage.java:828)
      at org.jboss.mq.SpyTextMessage.readExternal(SpyTextMessage.java:78)
      at org.jboss.mq.SpyMessage.readMessage(SpyMessage.java:726)
      at org.jboss.mq.il.oil.OILServerILService$Client.run(OILServerILService.java:249)
      at java.lang.Thread.run(Thread.java:536)



      I tried to take out the "queue/" from the Remote JNDI Name but then I get this exception :

      error lookuing up "QNO.0001.L"
      javax.naming.NameNotFoundException: QNO.0001.L not bound


      Has anyone know how to do this ? Thanks !

        • 1. Re: Send message from weblogic to JBoss
          pepgrifell

          I found the solution. I put the libraries jboss-all-client.jar and jboss.jar in the weblogic lib but I forgot to put the library jbossmq-cilent.jar. That´s I was getting the "Class not found for unknown destination" error.

          I tried as well to send messages from JBoss to Weblogic. I tried to put the libraries wlcinet.jar and wljmsclient.jar in the jboss lib but I was getting lots of errors while I was starting JBoss. Then I took the library weblogic.jar and I put it in the jboss lib and everything was ok.

          A few things :

          to do a lookup of JBoss JNDI from an application in weblogic :

          Properties env = new Properties();
          InitialContext ctx = null;
          env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
          env.put(Context.PROVIDER_URL,"jnp://182.138.24.121:1099");
          env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
          ctx = new InitialContext(env);
          QueueConnectionFactory qcf=(QueueConnectionFactory)ctx.lookup("ConnectionFactory");
          qc=qcf.createQueueConnection();
          QueueSession qs=qc.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
          Queue q=(Queue)ctxWeblogic.lookup(queue/queue1);
          


          to do a lookup of weblogic JNDI from an application in JBoss :

          Properties env = new Properties();
          InitialContext ctx = null;
          env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
          env.put(Context.PROVIDER_URL, "t3://182.138.24.121:7005");
          ctx = new InitialContext(env);
          QueueConnectionFactory qcf=(QueueConnectionFactory)ctx.lookup(weblogic.jms.ConnectionFactory);
          qc=qcf.createQueueConnection();
          QueueSession qs=qc.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
          Queue q=(Queue)ctxWeblogic.lookup(jms/queue1); // jms/ instead of queue/ !!
          




          • 2. Re: Send message from weblogic to JBoss
            maxi72

            hi, i put wljmsclient.jar,weblogic.jar,wlclient.jar in jboss\server\default\lib.
            But when i start my Jboss (via run.bat) i receive this error :

            log | CMS | 19/apr/2004 13:04:50,671 org.jboss.naming.NamingService | Starting jnp server
            log | CMS | 19/apr/2004 13:04:50,812 org.jboss.naming.NamingService | Started jnpPort=1199, rmiPort=1198, backlog=50, bindAddress=/0.0.0.0, Client SocketFactory=null, Server SocketFactory=org.jboss.net.sockets.DefaultSocketFactory@ad093076
            log | CMS | 19/apr/2004 13:04:50,953 org.jboss.naming.NamingService | Starting failed
            javax.naming.NameNotFoundException: remaining name: java:
            at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:49)
            at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:62)
            at javax.naming.InitialContext.lookup(InitialContext.java:347)
            at org.jboss.naming.NamingService.startService(NamingService.java:197)
            at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)

            can you help me ?

            • 3. Re: Send message from weblogic to JBoss
              hama

              jndi.properties in wlclient.jar seems to be the culprit.

              Looking at its content, it seems to intecept all the jndi request
              === jndi.properties ===
              # jndi properties for the thin-client

              # make sure we intercept requests for java:
              java.naming.factory.url.pkgs=weblogic.corba.j2ee.naming.url:weblogic.corba.client.naming
              ===
              Removing it from wlclient.jar seems to solve the jboss startup problem. I still have to test the connectivity though.