In the following code fragment, I try to send a text message to the testQueue and receive it back. The send
works ok but not receive.
QueueConnectionFactory qfac = ServiceLocator.getInstance().getQueueConnectionFactory(
"java:/ConnectionFactory");
QueueConnection conn = qfac.createQueueConnection();
Queue queue = ServiceLocator.getInstance().getQueue(
"queue/testQueue");
QueueSession session = conn.createQueueSession(
false, QueueSession.AUTO_ACKNOWLEDGE);
Message msg =
session.createTextMessage("hello");
QueueSender sender = session.createSender(queue);
sender.send(msg);
QueueReceiver receiver = session.createReceiver(queue);
TextMessage message = (TextMessage) receiver.receive(30000);
The error messages are:
[OILClientIL] ConnectionReceiverOILClient is connecting to: <some ip>:2204
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2133)
at java.io.ObjectInputStream$BlockDataInputStream.readBlockHeader(ObjectInputStream.java:2316)
at java.io.ObjectInputStream$BlockDataInputStream.refill(ObjectInputStream.java:2383)
at java.io.ObjectInputStream$BlockDataInputStream.read(ObjectInputStream.java:2455)
at java.io.ObjectInputStream$BlockDataInputStream.readByte(ObjectInputStream.java:2604)
at java.io.ObjectInputStream.readByte(ObjectInputStream.java:845)
at org.jboss.mq.il.oil.OILServerILService$Client.run(OILServerILService.java:205)
at java.lang.Thread.run(Thread.java:536)
I tried the same thing using testTopic and gets the same error.
Any idea?
I tried the tests on both JBoss 3.0.4 and 3.0.7 with Embedded Tomcat.