setting the initial context
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   pretty_cheran
Posted On:   Monday, August 8, 2005 02:28 AM

this is the code i user for putting a arraylist of objects in the JMS queue Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory"); env.put(Context.PROVIDER_URL, "http://localhost:7001"); Context ctx = new InitialContext(env); QueueConnectionFactory qconFactory = (javax.jms.QueueConnectionFactory) ctx.lookup("com.test.jms.QueueConnectionFactory"); QueueConnection qcon = qconFactory.createQueueConnection(); Queue queue = (Queue) ctx.lookup("test.jms.filereader.ii.queue"); QueueSession qsession = qcon.createQueueSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE   More>>

this is the code i user for putting a arraylist of objects in the JMS queue


Hashtable env = new Hashtable();

env.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");

env.put(Context.PROVIDER_URL, "http://localhost:7001");

Context ctx = new InitialContext(env);

QueueConnectionFactory qconFactory = (javax.jms.QueueConnectionFactory) ctx.lookup("com.test.jms.QueueConnectionFactory");

QueueConnection qcon = qconFactory.createQueueConnection();

Queue queue = (Queue) ctx.lookup("test.jms.filereader.ii.queue");

QueueSession qsession = qcon.createQueueSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);

QueueSender qsender = qsession.createSender(queue);

qcon.start();


ObjectMessage objectMessage = qsession.createObjectMessage();

objectMessage.setObject(paymentObjectArray);


qsender.send(objectMessage);

qcon.close();



i get a error as follows


javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory. Root exception is java.lang.ClassNotFoundException: weblogic.jndi.WLInitialContextFactory


i am very new to weblogic...can any one help me in setting up the environment properties....i have the class path mapped to weblogic.jar...

   <<Less

Re: setting the initial context

Posted By:   Sam_A  
Posted On:   Monday, August 8, 2005 05:40 AM

Seems like your JNDI library is not in classpath, dont know much about Weblogic but if you can find out which jar contains your JNDI implementation and include them in classpath. See if there is a file like jndi.jar .. or something that indicates it contains jndi classes.
About | Sitemap | Contact