I am trying to run a sample JMS application from java.sun.com(for j2ee 1.3.1). But I am using j2ee 5.I compiled the sender and receiver programs. I started the server using the command "start-appserv" and then added a jms destinaton using "create-jmsdest --desttype=queue MyQueue". These command were succesfully run.Then I tried to run the sender program using the command "java -Djms.propertes=c:\sun\appserver\ config\jms_client.properties SimpleQueueReceiver MyQueue 3"(This command is given in the tutorial).Here MyQueue is the queue name and 3 is the number of messages.
I got the following 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 an application resource file: java.naming.factory.initial
Also, I dont find "jms_client.properties" file in j2ee 5 package.
Can someone help me.
You probably are using an incorrect jndiname to lookup the connection factory. Depending on which application server you are using, you can check the JNDI tree to see what name the connection factory is bound to and then use that jndiname in your code.
Thankyou JaiKiran for the reply. I added an instance of QueueConnectionFactory through the Administrative Console. I also added an instance of physical destination of type queue called "MyQueue". The program is now identifying QueueConnectionFactory.But it is showing an exception for MyQueue as,