jms run
When i want to run a jms application with java <class> I get an error. But when I run it with vbj it works.
The error i get is:javax.naming.NoInitialContextException:
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(NamingManager.java:643)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:283)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at test.FrameJms.jbInit(FrameJms.java:35)
at test.FrameJms.<init>(FrameJms.java:23)
This is the code :
TopicConnectionFactory factory;
javax.naming.Context context;
context = new javax.naming.InitialContext();
factory = (javax.jms.TopicConnectionFactory) context.lookup("example/MQueueFactory");
does anybody have an idea of how I can let is run
[1110 byte] By [
wvtbg] at [2007-9-26 1:30:22]

Its obvious from the exception that your client is not able to find a setting for java.naming.factory.initial This is the environment property that specifies the class to use as the initial context.
Try running your application with the command line parameter -Djava.naming.factory.initial=<initial context class depending on your JNDI server>
I would recommend reading this http://www.javasoft.com/products/jms/tutorial/doc/client.html#1025459
I am not able to specify the parameter
-Djava.naming.factory.initial at command line because the class that needs to publish the JMS message is invoked because of an action performed by a webclient(The application is not started from a main method).
Is it possible to specify this parameter using properties or does anybody know another way how to solve this problem?
Sone at 2007-6-29 1:28:21 >

In addition you can specify these parameters in a file that you call jndi.properties and put into your classpath.
example format for this file:
java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory
java.naming.provider.url=file:/jnditutorial/
this example is for using Suns file based implementation of JNDI, a basing this in a directory called jnditutorial.
You can then call
Context ctx = new InitialContext() with no parameters - the method will look in the properties file.
It'd definitely be worth reading the tutorials though.