Hi,
I am new to the JMS Concept.
I tried with few example progs from the net for JMS.
When I try to look up, I get the following error.
java.lang.ClassCastException: weblogic.jms.common.DestinationImpl
at icomsMsgQueue.MessageProcessor.initSend(MessageProcessor.java:32)
at icomsMsgQueue.ICOMSMsgQueue.sendMsg(ICOMSMsgQueue.java:51)
at icomsMsgQueue.TestCode.main(TestCode.java:11)
This is the source:
public void initSend(
String QCFName, String QName, String user, String pass, boolean transacted)
{
try
{
//qcf.createQueueConnection();
System.out.println("3333+++++33333");
qcf = (QueueConnectionFactory) initProcess(QCFName);
System.out.println("3333-----33333");
q = (Queue) initProcess(QName);
qc = ((user != null) && (pass != null)? qcf.createQueueConnection(user, pass): qcf.createQueueConnection());
qs = qc.createQueueSession(transacted, Session.AUTO_ACKNOWLEDGE);
snd = qs.createSender(q);
System.out.println("qcf:"+qcf+" q:"+q+" qc:"+qc+" qs:"+qs+" snd:"+snd);
qc.start();
}
catch(Exception e)
{
e.printStackTrace();
}
}
public Object initProcess(String name)
{
try
{
Hashtable ht = new Hashtable();
System.out.println("11111");
ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.T3InitialContextFactory");
ht.put(Context.PROVIDER_URL, "t3://localhost:7001");
//ht.put("java.naming.security.principal", "weblogic");
//ht.put("java.naming.security.credentials", "welcome");
Context ctx = new InitialContext(ht);
retLookup = ctx.lookup(name);
ctx.close();
System.out.println("1111++++1111"+retLookup);
}
catch(Exception e)
{
e.printStackTrace();
}
return retLookup;
}
Kindly tell me what I am missing out.
If you need any more info, pls let me know.