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

[1353 byte] By [Yuriy.Chumaka] at [2007-11-27 11:44:02]
# 1

Seems the following is a resolving of my problem.

NamingContext of the j2eesdk or appserver8 can only be used by application server components running inside the server. This is because the J2EE platform is not required to make it's resources available to standalone J2SE applications.

For standalone J2SE program that use JMS it is need to use standalone JMS provider of service.

Yuriy.Chumaka at 2007-7-29 17:53:20 > top of Java-index,Application & Integration Servers,Sun Java System Message Queue...