Hi all.
I am trying to get a Request and Reply mechanism working, but I am getting a
weird exception: Exception occurred: javax.jms.InvalidDestinationException:
Invalid queue. Does anyone have a suggestion ?
QueueConnection queueConnection = null;
try {
Context ctx = new InitialContext();
QueueConnectionFactory
queueConnectionFactory = ( QueueConnectionFactory
)
ctx.lookup("jms/QueueConnectionFactory");
queueConnection =
queueConnectionFactory.createQueueConnection();
queueSession =
queueConnection.createQueueSession( false,Session.AUTO_ACKNOWLEDGE );
Queue
queue = queueSession.createQueue( "jms/myQueue" );
queueConnection.start();
QueueRequestor requestor = new QueueRequestor( queueSession, queue
);
TextMessage message =
queueSession.createTextMessage();
message.setText( "helloooo" );
Message
response = requestor.request( message );
System.out.println( ( ( TextMessage
) response ).getText() );
}
catch (NamingException e) {
System.out.println("Could not create JNDI context: " + e.toString()
);
System.exit( 1 );
}
catch( JMSException ex ) {
System.out.println("Exception occurred: " + ex.toString());
}
finally
{
if (queueConnection != null) {
try
{
queueConnection.close();
}
catch (JMSException e)
{}
}
}
}
The stack trace:
javax.jms.InvalidDestinationException: Invalid
queue
javax.jms.QueueReceiver
com.evermind.server.jms.EvermindQueueSession.createReceiver(javax.jms.Queue,
java.lang.String)
javax.jms.QueueReceiver
com.evermind.server.jms.EvermindQueueSession.createReceiver(javax.jms.Queue)
void
javax.jms.QueueRequestor.<init>(javax.jms.QueueSession,
javax.jms.Queue)
void jmsMiddleware.TestServer.<init>()
void
jmsMiddleware.TestServer.main(java.lang.String[])
Exception occurred:
javax.jms.InvalidDestinationException: Invalid queue
Regards Corne Vermeulen