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

    JBoss JMS JNDI lookup NameNotFoundException

    John Wasmat Newbie

      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