Skip to Content

Accessing Queue Connection Factory from java application


I am trying to access the queue connection factory from a standalone java application. I am using the following code

<b>Properties props = new Properties();
QueueConnectionFactory queueConnFact = null;		
props.put("Context.INITIAL_CONTEXT_FACTORY", "");
props.put("Context.PROVIDER_URL", "server:50004");
props.put("Context.SECURITY_PRINCIPAL", "user");
props.put("Context.SECURITY_CREDENTIALS", "pass");
Context ctx = new InitialContext(props);
// Look up the connection factory
queueConnFact = (QueueConnectionFactory)PortableRemoteObject.narrow(ctx.lookup("jmsfactory/default/QueueConnectionFactory"), QueueConnectionFactory.class);</b>

However i get the following exception.

<i><b>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</b></i>

Please do let me know what additional i have to do make the code work.



Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Jun 13, 2005 at 06:47 AM

    Hi Sidharth,

    Take a look at are-they-any-ways-to-help-performance-on-jms



    Add comment
    10|10000 characters needed characters exceeded