i am trying to execute this simple example SimpleQueueSender.java from the tutorial provided at
http://java.sun.com/products/jms/tutorial/1_3_1-fcs/doc/client.html#1027210 in this example it is creating empty initial context;
jndiContext = new InitialContext();
with empty InitialContext i got (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)
so i have modified it to
Properties prop = new Properties();
prop.setProperty(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
prop.setProperty(Context.PROVIDER_URL, "t3://192.168.3.91:7001");
jndiContext = new InitialContext(prop);
after making this changes and looking up for
queueConnectionFactory = (QueueConnectionFactory) jndiContext.lookup("QueueConnectionFactory"); // here it is returning weblogic.jms.common.DestinationImpl.classs
i am still getting java.lang.ClassCastException
i have configured weblogic 8.1 and created new JMS server and created JMSQueue named 'QueueConnectionFactory' and JNDI name 'jndi_QueueConnectionFactory'
what else do i need to add or change to my code or environment
also tell me is this
Context.INITIAL_CONTEXT_FACTORY = "weblogic.jndi.WLInitialContextFactory" right value
******************************************************************************************