From my client program when I try to send messages to two different JMS
servers, I get weblogic.jms.common.JMSException: Connection not found. Both
the servers are installed with Weblogic Server 6.1 SP1 on 1.3.1 JDK.
Can anyone help know, what is wrong.
Thanks in Advance,
-Ravi.
S O U R C E
=========
import javax.jms.*;
import java.util.Properties;
import javax.naming.*;
public class JMSTest
{
public JMSTest()
{
}
public static void main(String[] args)
{
JMSTest client = new JMSTest();
//client.sendMessage("t3://dev5:7001","weblogic.jndi.WLInitialContextFactory
","QCFactory","umsprimary","Hello Message");
client.sendMessage("t3://dev5:7001","weblogic.jndi.WLInitialContextFactory",
"QCFactory","smsprimary","Hello Message");
client.sendMessage("t3://kahless:7001","weblogic.jndi.WLInitialContextFactor
y","QCFactory","umsprimary","Hello Message");
}
public void sendMessage(String inURL, String inCtxFactory, String
inQueueFactory, String inQueue, String inMsg)
{
try
{
Properties prop = new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY,inCtxFactory);
prop.put(Context.PROVIDER_URL,inURL);
Context ctx = new InitialContext(prop);
QueueConnectionFactory qcf = (QueueConnectionFactory)
ctx.lookup(inQueueFactory);
QueueConnection qConn = qcf.createQueueConnection();
QueueSession qSession = qConn.createQueueSession(false,
Session.AUTO_ACKNOWLEDGE);
Queue q = (Queue) ctx.lookup(inQueue);
QueueSender qSender = qSession.createSender(q);
TextMessage msg = qSession.createTextMessage(inMsg);
qSender.send(msg);
System.out.println("Message Sent Successfully!");
}
catch(Exception e)
{
System.out.println("Exception Occured");
e.printStackTrace();
}
}
}
O U T P U T
=========
Message Sent Successfully!
Exception Occured
weblogic.jms.common.JMSException: Connection not found
Start server side stack trace:
weblogic.jms.common.JMSException: Connection not found
at
weblogic.jms.dispatcher.InvocableManager.invocableFind(InvocableManager.java
:121)
at
weblogic.jms.dispatcher.Request.wrappedFiniteStateMachine(Request.java:503)
at
weblogic.jms.dispatcher.DispatcherImpl.dispatchAsync(DispatcherImpl.java:149
)
at
weblogic.jms.dispatcher.DispatcherImpl.dispatchSyncFuture(DispatcherImpl.jav
a:300)
at weblogic.jms.dispatcher.DispatcherImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:296)
at
weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:265)
at
weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:2
2)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
End server side stack trace
at
weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundRequest.
java:85)
at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:134)
at weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:35)
at $Proxy2.dispatchSyncFuture(Unknown Source)
at
weblogic.jms.dispatcher.DispatcherWrapperState.dispatchSync(DispatcherWrappe
rState.java:262)
at
weblogic.jms.client.JMSConnection.sessionCreate(JMSConnection.java:261)
at
weblogic.jms.client.JMSConnection.createQueueSession(JMSConnection.java:228)
at com.adspedia.msg.amp.test.JMSTest.sendMessage(JMSTest.java:35)
at com.adspedia.msg.amp.test.JMSTest.main(JMSTest.java:20)
My current project is building a messaging system using JMS, it requires
multiple connection to be alive at the same time to receive and dispatch
messages.
Any ideas,
Thanks,
-Ravi.
"Weblogic" <ravi...@mail.netzero.net> wrote in message
news:3c24...@newsgroups.bea.com...
_sjz.
"Weblogic" <ravi...@mail.netzero.net> wrote in message
news:3c24dde8$1...@newsgroups.bea.com...