8 Replies Latest reply on Aug 4, 2013 9:02 AM by lakshram

    JBoss JMS JNDI lookup NameNotFoundException

    johnwasmat

      Hello,

       

      Following is my JMS client code. I`m getting a NameNotFoundException. I`m struggling for almost 2 weeks now and would appreciate any help

       

      Clinet code:

       

          private static final String DEFAULT_MESSAGE = "Hello, World!";

          private static final String DEFAULT_CONNECTION_FACTORY = "jms/RemoteConnectionFactory";

          private static final String DEFAULT_DESTINATION = "jms/queue/test";

          private static final String DEFAULT_MESSAGE_COUNT = "1";

          private static final String DEFAULT_USERNAME = "admin";

          private static final String DEFAULT_PASSWORD = "admin";

          private static final String INITIAL_CONTEXT_FACTORY = "org.jboss.naming.remote.client.InitialContextFactory";

          private static final String PROVIDER_URL = "remote://127.0.0.1:4447";

       

       

       

      final Properties env = new Properties();

                  env.put(Context.INITIAL_CONTEXT_FACTORY, INITIAL_CONTEXT_FACTORY);

                  env.put(Context.PROVIDER_URL, System.getProperty(Context.PROVIDER_URL, PROVIDER_URL));

                  env.put(Context.SECURITY_PRINCIPAL, System.getProperty("username", DEFAULT_USERNAME));

                  env.put(Context.SECURITY_CREDENTIALS, System.getProperty("password", DEFAULT_PASSWORD));

                  context = new InitialContext(env);

       

       

                  // Perform the JNDI lookups

                  String connectionFactoryString = System.getProperty("connection.factory", DEFAULT_CONNECTION_FACTORY);

                  log.info("Attempting to acquire connection factory \"" + connectionFactoryString + "\"");

                  connectionFactory = (ConnectionFactory) context.lookup(connectionFactoryString);

                  log.info("Found connection factory \"" + connectionFactoryString + "\" in JNDI");

       

       

      "admin" "admin" is added as an ApplicationRealm user. following is the exception i`m getting

       

      SEVERE: Error in setupPubSub jboss/exported/jms/topic/ServerNotification -- service jboss.naming.context.java.jboss.exported.jboss.exported.jms.topic.ServerNotification

      javax.naming.NameNotFoundException: jboss/exported/jms/topic/ServerNotification -- service jboss.naming.context.java.jboss.exported.jboss.exported.jms.topic.ServerNotification

                at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:97)

                at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:178)

                at org.jboss.naming.remote.protocol.v1.Protocol$1.handleServerMessage(Protocol.java:127)

                at org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.run(RemoteNamingServerV1.java:73)

                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

                at java.lang.Thread.run(Thread.java:722)

       

      Thanks

        • 1. Re: JBoss JMS JNDI lookup NameNotFoundException
          johnwasmat

          This is another exception that I`m getting

          SEVERE: Error in setupPubSub jms/RemoteConnectionFactory -- service jboss.naming.context.java.jboss.exported.jms.RemoteConnectionFactory

          javax.naming.NameNotFoundException: jms/RemoteConnectionFactory -- service jboss.naming.context.java.jboss.exported.jms.RemoteConnectionFactory

                    at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:97)

                    at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:178)

                    at org.jboss.naming.remote.protocol.v1.Protocol$1.handleServerMessage(Protocol.java:127)

                    at org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.run(RemoteNamingServerV1.java:73)

                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

                    at java.lang.Thread.run(Thread.java:722)

          • 2. Re: JBoss JMS JNDI lookup NameNotFoundException
            wdfink

            Hi John,

            welcome to the forum

             

            As you use AS7 you might have a look into the quickstarts, for you #25 helloworld-jms might be helpful.

             

            If you have still questions feel free to ask.

            • 3. Re: JBoss JMS JNDI lookup NameNotFoundException
              johnwasmat

              Thanks a ton Mr Fink. I`ll go thru that and try to figure out the issue. If you know of a fix on the top of your head do let me know. Thanks

              • 4. Re: JBoss JMS JNDI lookup NameNotFoundException
                wdfink

                Glad to hear that it helps, that what the quickstarts for.

                 

                you should also set the thread to answered

                • 5. Re: JBoss JMS JNDI lookup NameNotFoundException
                  johnwasmat

                  Helo,

                   

                  I tried the quickstart example but still getting the same rror. Can someone please help. Am I missing any confiiguration settings on the server side?

                  • 6. Re: JBoss JMS JNDI lookup NameNotFoundException
                    thlim

                    I had the similar problem a few days ago. My problem was the queue destination name. Apparently, ConnectionFactory and destination names are different when connecting locally and remotely. This is bit tricky but I think you will find your answers in the manual. I found mine trail and error and had to RTM to understand the convention used.

                    • 7. Re: JBoss JMS JNDI lookup NameNotFoundException
                      lakshram

                      Hi John,

                       

                      I m also facing the same problem..

                      have you got any solution for the problem..

                      • 8. Re: JBoss JMS JNDI lookup NameNotFoundException
                        lakshram

                        Hi all,

                         

                         

                        Finally it worked... I could able achieve JMS using Jboss7.1.1.Final... Thanks all for the help.!!