4 Replies Latest reply on Jan 15, 2009 11:15 AM by taher mohak

    Send JMS to Jbossesb from jboss

    David Griffioen Newbie

      I try to send a jms message to jbossesb from within jboss.
      When I send the message from a 'stand alone' client it works oke.
      When I use the same code 'in' Jboss and don't add any additional jars I get a class not found:


      When I add the jboss-messaging-client.jar from jbossesb to the server\default\lib of jboss I get an error on the ESB:

      [BisocketServerInvoker] received new control socket for unrecognized listenerId: 1234....


      So I try to send a JMS message to a JBossESB from within a JBoss. How to do this? Which Jars do i need?

      JBoss 4.2.1. GA (the zip says: 4.4 GA)
      JBossESB 4.2.2 GA

      All help is appriciated!


      public void setupConnection() throws JMSException, NamingException {
       Properties jndiProps = new Properties();
       jndiProps.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
       jndiProps.setProperty("java.naming.provider.url","jnp://localhost:1099");
       jndiProps.setProperty("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
       InitialContext iniCtx = new InitialContext(jndiProps);
       Object tmp = iniCtx.lookup("ConnectionFactory");
       QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
       conn = qcf.createQueueConnection();
       // que = (Queue) iniCtx.lookup("queue/quickstart_custom_action_GW");
       que = (Queue) iniCtx.lookup("queue/quickstart_helloworld_Request_gw");
       session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
       conn.start();
       System.out.println("Connection Started");
      }
      


        • 1. Re: Send JMS to Jbossesb from jboss
          David Griffioen Newbie

          Hmm. I forgot to copy the class not found exception, the class missing is: org.jboss.jms.client.JBossConnectionFactory


          16:13:43,031 ERROR [STDERR] Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: org.jboss.jms.client.JBossConnectionFactory (no security manager: RMI class loader disabled)
          16:13:43,031 ERROR [STDERR] at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:371)
          16:13:43,031 ERROR [STDERR] at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:165)
          16:13:43,031 ERROR [STDERR] at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
          16:13:43,031 ERROR [STDERR] at org.jboss.system.JBossRMIClassLoader.loadClass(JBossRMIClassLoader.java:91)
          16:13:43,031 ERROR [STDERR] at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
          16:13:43,031 ERROR [STDERR] at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
          16:13:43,031 ERROR [STDERR] at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1544)
          16:13:43,031 ERROR [STDERR] at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
          16:13:43,031 ERROR [STDERR] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
          16:13:43,031 ERROR [STDERR] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
          16:13:43,031 ERROR [STDERR] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)


          • 2. Re: Send JMS to Jbossesb from jboss
            Daniel Bevenius Master

            Hi,

            If you have replaced added jboss-messaging.jar as described here: http://wiki.jboss.org/wiki/JBossMessagingJBossMQMigrationGuide,
            and getting the error described below this might be caused by different JBoss Remoting versions.
            Remoting version:
            JBoss-4.2.1.GA uses JBossRemoting Version 2.2.1.GA (Bluto)
            JBossESB4.2.2 uses JBossRemoting Version 2.2.2.SP2 (Bluto).

            Can you try replacing the jboss-remoting.jar in JBoss-4.2.1.GA/server/default/lib with the one from JBossESB4.2.2/server/default/lib and see if that works?

            Regards,

            /Daniel


            • 3. Re: Send JMS to Jbossesb from jboss
              David Griffioen Newbie

              Thanks,

              After trial and error I did almost the same thing, just the other way around (I copied the jboss-remoting.jar from JBoss to JBossESB).
              Now it works.

              • 4. Re: Send JMS to Jbossesb from jboss
                taher mohak Newbie

                hi griffioen42


                I try to send a jms message to jbossesb from within jboss.
                but i don't know do,
                can you example send to me .

                thanks