Where are you performing JNDI lookup? Is it POJO or managed component? I think that your InitialContext configuration is bad. If you are inside a managed component you can try:
new InitialContext().lookup("....").

I think I didn't put up my question correctly and you are right my initial context is not right. My query is regarding correcting this initial context only. What should I put in the hashtable or properties to get hold of a context where I'll be able to look up for a queue defined in JBoss AS 7.

Thanks
Yogi

Yogendra Singh Butola
Greenhorn

Joined: Sep 28, 2011
Posts: 13

posted Jan 24, 2013 22:19:18

0

And yes this is a POJO.

Yogendra Singh Butola
Greenhorn

Joined: Sep 28, 2011
Posts: 13

posted Jan 25, 2013 05:23:14

0

Thanks, I got the answer.

Following is the correct way of setting perovider URL:

envmnt.put(Context.PROVIDER_URL, "remote://localhost:4447");

After that you need to provide the credentials (username and password)