JMS application in terminal ( from command line )
Hello.
I am learning JMS and have created a small program from O`Reilly JMS book (Chat server). It works fine inside environment of NetBeans+JSAS but when I try to launch this application from command line I am receiving following error message:
C:\sun\projects\ChatServer\dist>java -cp ChatServer.jar;c:/sun/AppServer/lib/javaee.jar chatserver.Chat
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
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at chatserver.Chat.<init>(Chat.java:56)
at chatserver.Chat.main(Chat.java:99)
in my code is following:
54:InitialContext jndi = new InitialContext();
56:TopicConnectionFactory conFactory = (TopicConnectionFactory)jndi.lookup("TopicConnectionFactory");
Please, could anybody explain me how can I to set up jndi parameters. There are many tutorials but all of then shows how to use ldap server, but in my example I don't use any ldap servers.
Thanks,
YNC

