OK.
Im using the Glass fish Application server (just in case, setting the variables is related to the application server used)
Main Topics
Browse All TopicsIm running a JMS Application using a queue.
- It runs Fine.
- BUT when I do a Debug (F7 in netbeans) , It gives an exception in method initJMS() (code attached).
javax.naming.NoInitialCont
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Try this...
http://java.sun.com
Appa
The approach I used was same as that, but instead of Context.Applet, I was using INITIAL_CONTEXT_FACTORY (http://java.sun.com/j2se/
Thanks for the tidbit. This is for GlassFish: https://glassfish.dev.java
It is for enumerating names within JNDI, so target would be a name you are looking for. Think only adjustment you had to make to your code was setting of the environment before instantiating JNDI.
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CO
InitialContext jndi = new InitialContext(env);
And then do the jndi lookup that you did before, but you may have to change this to "com.sun.appserv.naming.S1
think because you are using this for the initial context factory. it should be a string that is the fully qualified name of class that handles it as a string literal like:
"com.sun.appserv.nami
Quotes were meant to be included, I should have made that clear above. This is another listed:
"com.sun.jndi.cosna
This is the exception after using "com.sun.appserv.naming.S1
javax.naming.NoInitialCont
Now, while running also I get an exception. but Its different:
java.lang.RuntimeException
OK. I have located the class and added it to library.
now on debugging (F7), i'm getting:
Sep 16, 2008 3:58:36 PM com.sun.appserv.naming.Rou
WARNING: NAM1005 : No Endpoints selected. Please specify using system property com.sun.appserv.iiop.endpo
Sep 16, 2008 3:58:36 PM com.sun.appserv.naming.S1A
SEVERE: NAM1005 : No Endpoints selected. Please specify using system property com.sun.appserv.iiop.endpo
java.lang.RuntimeException
mwvisa1,
Now it works.
The code is:
Hashtable env = new Hashtable();
env.put(Context.PROVIDER_U
env.put(Context.INITIAL_CO
and I had to add some jar files to library.
Got this from one of the links you posted. Thanks a lot for your help.
But one thing im curious to know is , How was it running perfectly before. I had not done any of these settings.
Think because you are running through the debugger. If the server has the appropriate classes in its classpath already, this probably worked by taking the default path for initial context. Whenever I had to do this it was always remote to a directory service so I had to implement using naming context in this fashion which is why it came to mind so not necessarily an indication it won't work when you are running productionally again.
Think because you are running through the debugger. If the server has the appropriate classes in its classpath already, this probably worked by taking the default path for initial context. Whenever I had to do this it was always remote to a directory service so I had to implement using naming context in this fashion which is why it came to mind so not necessarily an indication it won't work when you are running productionally again.
Business Accounts
Answer for Membership
by: mwvisa1Posted on 2008-09-16 at 00:28:48ID: 22485762
Whenever I have used JNDI, I have always specified the Environment setting for the initial context, which you are picking up fine when running the application as it is picking up default; however, debugger needs it explicit or at least that is what the error is noting.
I will post an example of how I set in environment in a sec.