I have created a Connection factory with jndi name 'jmsConnectionFactory1' and a jms queue with jndi name 'Queue-1' in system 10.238.115.217.
And I write the following code and run on a different system (10.238.115.201). It's throwing
weblogic.jms.common.JMSException: Connection not found
But if I create those same queues in local system and change the url to
t3://localhost:7001 in provider url, connectionfactory,destination queue in the same code ;it works fine,the queue in local system gets the sent message.
Context context= new InitialContext();
context.addToEnvironment(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
context.addToEnvironment(Context.PROVIDER_URL,"t3://10.238.115.217:7001");
context.addToEnvironment(Context.SECURITY_AUTHENTICATION,"weblogic");
context.addToEnvironment(Context.SECURITY_CREDENTIALS,"weblogic");
context.addToEnvironment(Context.SECURITY_PRINCIPAL,"weblogic");
QueueConnectionFactory conFact=(QueueConnectionFactory)context.lookup("t3://10.238.115.217:7001/jmsConnectionFactory1");
QueueConnection connection=conFact.createQueueConnection();
Queue queue=(Queue)context.lookup("t3://10.238.115.217:7001/Queue-1");
QueueSession session=connection.createQueueSession(true,Session.AUTO_ACKNOWLEDGE);
QueueSender qs=session.createSender(queue);
TextMessage message=session.createTextMessage("hi its very urgent please");
qs.send(message);
connection.close();
please help me out..
----------------------
this excepton is thrown at this statement
QueueSession session=connection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
weblogic.jms.common.JMSException: Connection not found
<Nov 2, 2006 7:33:25 PM IST> <Warning> <
EJB> <BEA-010096> <The Message-Driven EJ
B: jms_mdb is unable to connect to the JMS destination: Queue-1. Connection fail
ed after 2 attempts. The MDB will attempt to reconnect every 10 seconds. This lo
g message will repeat every 600 seconds until the condition clears.>
<Nov 2, 2006 7:33:25 PM IST> <Warning> <EJB> <BEA-010061> <The Message-Driven EJ
B: jms_mdb is unable to connect to the JMS destination: Queue-1. The Error was:
[EJB:011010]The JMS destination with the JNDI name: Queue-1 could not be found.
Please ensure that the JNDI name in the weblogic-ejb-jar.xml is correct, and the
JMS destination has been deployed.>
(it says that jndi name Queue-1 is not found, but I created it in the same way,as I did one in my local system)
Thanks
[ November 02, 2006: Message edited by: Anil B ]