Discussion:
[jboss-user] [JNDI and Naming] - JBoss JMS JNDI lookup NameNotFoundException
John Wasmat
2012-06-28 04:36:06 UTC
Permalink
John Wasmat [https://community.jboss.org/people/johnwasmat] created the discussion

"JBoss JMS JNDI lookup NameNotFoundException"

To view the discussion, visit: https://community.jboss.org/message/744682#744682

--------------------------------------------------------------
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
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/744682#744682]

Start a new discussion in JNDI and Naming at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083]
John Wasmat
2012-06-28 04:53:34 UTC
Permalink
John Wasmat [https://community.jboss.org/people/johnwasmat] created the discussion

"Re: JBoss JMS JNDI lookup NameNotFoundException"

To view the discussion, visit: https://community.jboss.org/message/744683#744683

--------------------------------------------------------------
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)
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/744683#744683]

Start a new discussion in JNDI and Naming at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083]
Wolf-Dieter Fink
2012-06-28 06:41:32 UTC
Permalink
Wolf-Dieter Fink [https://community.jboss.org/people/wdfink] created the discussion

"Re: JBoss JMS JNDI lookup NameNotFoundException"

To view the discussion, visit: https://community.jboss.org/message/744699#744699

--------------------------------------------------------------
Hi John,
welcome to the forum :)

As you use AS7 you might have a look into the https://docs.jboss.org/author/display/AS71/Contributing+a+Quickstart quickstarts, for you #25 helloworld-jms might be helpful.

If you have still questions feel free to ask.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/744699#744699]

Start a new discussion in JNDI and Naming at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083]
John Wasmat
2012-06-28 13:43:08 UTC
Permalink
John Wasmat [https://community.jboss.org/people/johnwasmat] created the discussion

"Re: JBoss JMS JNDI lookup NameNotFoundException"

To view the discussion, visit: https://community.jboss.org/message/744778#744778

--------------------------------------------------------------
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
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/744778#744778]

Start a new discussion in JNDI and Naming at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083]
Wolf-Dieter Fink
2012-06-28 18:58:31 UTC
Permalink
Wolf-Dieter Fink [https://community.jboss.org/people/wdfink] created the discussion

"Re: JBoss JMS JNDI lookup NameNotFoundException"

To view the discussion, visit: https://community.jboss.org/message/744895#744895

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

you should also set the thread to answered
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/744895#744895]

Start a new discussion in JNDI and Naming at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083]
John Wasmat
2012-06-30 21:34:17 UTC
Permalink
John Wasmat [https://community.jboss.org/people/johnwasmat] created the discussion

"Re: JBoss JMS JNDI lookup NameNotFoundException"

To view the discussion, visit: https://community.jboss.org/message/745228#745228

--------------------------------------------------------------
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?
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/745228#745228]

Start a new discussion in JNDI and Naming at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083]
TH Lim
2012-07-02 02:38:47 UTC
Permalink
TH Lim [https://community.jboss.org/people/thlim] created the discussion

"Re: JBoss JMS JNDI lookup NameNotFoundException"

To view the discussion, visit: https://community.jboss.org/message/745334#745334

--------------------------------------------------------------
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.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/745334#745334]

Start a new discussion in JNDI and Naming at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083]
Lakshman Kumar
2013-08-04 11:10:33 UTC
Permalink
Lakshman Kumar [https://community.jboss.org/people/lakshram] created the discussion

"Re: JBoss JMS JNDI lookup NameNotFoundException"

To view the discussion, visit: https://community.jboss.org/message/831291#831291

--------------------------------------------------------------
Hi John,

I m also facing the same problem..
have you got any solution for the problem..
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/831291#831291]

Start a new discussion in JNDI and Naming at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083]
Lakshman Kumar
2013-08-04 13:02:12 UTC
Permalink
Lakshman Kumar [https://community.jboss.org/people/lakshram] created the discussion

"Re: JBoss JMS JNDI lookup NameNotFoundException"

To view the discussion, visit: https://community.jboss.org/message/831296#831296

--------------------------------------------------------------
Hi all,


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

Reply to this message by going to Community
[https://community.jboss.org/message/831296#831296]

Start a new discussion in JNDI and Naming at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083]
Loading...