Why doesn't my JMS app work?
Hello!I need some help or advise with JMS.
I have test the sample application at:
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JMS5.html#wp81077
If I run it like they suggest like:
appclient -client SimpleProducer.jar jms/Queue 3
...It works perfect
But if I try to run it like:
java SimpleProducer jms/Queue 3
I get this exception:
JNDI API lookup failed: javax.naming.NoInitialContextException: Need to specify
class name in environment or system property, or as an applet parameter, or in a
n application resource file: java.naming.factory.initial
I guess that the first way to start the app defines some context that I do not get in the second way to start it.
Do you know any nice way to setup the context or any other resources programatically that I need to be able to start the app in the second way?
BTW
If you follow the example like I did from the url above, the downloadable code uses "jms/JupiterConnectionFactory" but the description tell you to set it like "jms/ConnectionFactory". So be sure you use the same JNDI Name.
Best regards
Fredrik
