6 Replies Latest reply on Sep 2, 2003 8:49 AM by karumady

    jms standalone client

    karumady Newbie

      I am developing an application that uses JBOSS server that sends JMS messages to a stand alone java program using "apache-messenger".
      Now both the applications are running on the same machine. But finally I want to run my java client appication in a seperate machine. Plzz help me to set up the things.If possible plzz send the me where in the configuration files I want to edit or create.

      Hoping for help .....

        • 1. Re: jms standalone client
          Adrian Brock Master

          Just configure your initial context to point at
          the remote machine in jndi.properties

          Regards,
          Adrian

          • 2. Re: jms standalone client
            karumady Newbie

            hai

            thankS for reply

            back to our discussion

            Should I need JBOSS in my standalone jms client machine.

            If so, in which mode I should run it(server\all or server\default ..etc)

            hoping replys..........

            • 3. Re: jms standalone client
              Adrian Brock Master

              No you just need the client jars.
              Start with jbossall-client.jar (it contains all jboss
              client code). Once you have it working you can cut it
              down to what you need.
              Probably just jnp-client.jar, jbossmq-client.jar and jbosscommon-client.jar?

              Regards,
              Adrian

              • 4. Re: jms standalone client
                wheyboer Newbie

                I have made a standalone client but i get the error:

                java.lang.NoClassDefFoundError: org/jboss/logging/Logger
                at org.jboss.mq.referenceable.SpyConnectionFactoryObjectFactory.(SpyConnectionFactoryObjectFactory.java:25)
                at java.lang.Class.forName0(Native Method)
                at java.lang.Class.forName(Class.java:195)
                at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:45)
                at javax.naming.spi.NamingManager.getObjectFactoryFromReference(NamingManager.java:132)
                at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:302)
                at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:437)
                at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:333)
                at javax.naming.InitialContext.lookup(InitialContext.java:350)
                at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:421)
                at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:333)
                at javax.naming.InitialContext.lookup(InitialContext.java:350)
                at com.triennium.accountviewqueueservice.client.QueueListener.(QueueListener.java:44)
                at com.triennium.accountviewqueueservice.client.QueueListener.main(QueueListener.java:27)

                when i lookup the QueueConnectionFactory on the remote context. my code :

                public QueueListener(){
                QueueConnectionFactory qFactory = null;
                InitialContext jndi = null;

                Properties env = new Properties();
                env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
                env.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
                env.put(Context.PROVIDER_URL, "myremotehostname:1099");
                env.put(Context.SECURITY_PRINCIPAL, "myusername");
                env.put(Context.SECURITY_CREDENTIALS, "mypassword");
                try{
                jndi = new InitialContext(env);
                //this lookup (below) does throw the error.
                //when i lookup a unexistent object, i get the
                //standard object not bound error. so it confuses me
                //that when i look up this queueconnection factory
                //i get the error

                qFactory = (QueueConnectionFactory)jndi.lookup


                ("QueueConnectionFactory");
                }
                catch(javax.naming.NamingException nex){
                nex.printStackTrace();
                }
                }

                i have included the whole jboss2.4.4 client directory
                (i cant work with other versions due to several reasons), so i am not missing jars. i have checked the jars and org.jboss.logging.logger is in the jars i included.

                I have also tried to include less jars but it does'nt matter, i still get the error.

                PLEASE help me out!!!

                has anyone some example code or experienced the same problems???

                • 5. Re: jms standalone client
                  avenet Newbie

                  I think you'll find the missing classes in the jar files included in the client/ dir.

                  • 6. Re: jms standalone client
                    karumady Newbie

                    use jbossall-client.jar