JMS-120: Dequeue failed Error While Dequeuing ObjectMessage Type With Null Value in Oracle Application Server 10.1.3

(Doc ID 1275904.1)

Last updated on MARCH 08, 2017

Applies to:

Oracle Containers for J2EE - Version 10.1.3.4.0 and later
Information in this document applies to any platform.

Symptoms

Dequeue of null message fails.

1. A Java MDB is deployed in Oracle Application Server 10.1.3.4 listening to AQ Queue in Oracle Database 11.2.0.1.
2. From standalone java JMS Program, a connection to AQ Queue is performed and an ObjectMessage type message is sent with null value.

Here is the snapshot from the program. Line-2 where object message is being created with null is the interest.

MessageProducer mp = queueSession.createProducer(queue);
ObjectMessage msg = queueSession.createObjectMessage(null);
mp.setDeliveryMode(DeliveryMode.PERSISTENT);
mp.setTimeToLive(24 * 7 * 60 * 60 * 1000);
mp.send(msg);



Expected result : Message sent in line-2 should dequeue by Listener MDB
Actual result : Message dequeue is failing with error :


<SUPPL_DETAIL><![CDATA[oracle.jms.AQjmsException: JMS-120: Dequeue failed
at oracle.jms.AQjmsError.throwEx(AQjmsError.java:308)
at oracle.jms.AQjmsConsumer.dequeue(AQjmsConsumer.java:2104)
at oracle.jms.AQjmsConsumer.receiveFromAQ(AQjmsConsumer.java:916)
at oracle.jms.AQjmsConsumer.receiveFromAQ(AQjmsConsumer.java:835)
at oracle.jms.AQjmsConsumer.receive(AQjmsConsumer.java:776)
at com.evermind.server.ejb.MessageDrivenConsumer.receiveMessage(MessageDrivenConsumer.java:424)
at com.evermind.server.ejb.MessageDrivenConsumer.processMessages(MessageDrivenConsumer.java:213)
at com.evermind.server.ejb.MessageDrivenConsumer.run(MessageDrivenConsumer.java:169)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
at java.lang.Thread.run(Thread.java:595)

Linked-exception
java.lang.NullPointerException
at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:89)
at oracle.jms.AQjmsObjectMessage.convertByteArrayToSerializable(AQjmsObjectMessage.java:410)
at oracle.jms.AQjmsObjectMessage.readObjectMessageContainer(AQjmsObjectMessage.java:759)
at oracle.jms.AQjmsObjectMessage.<init>(AQjmsObjectMessage.java:222)
at oracle.jms.AQjmsConsumer.dequeue(AQjmsConsumer.java:1708)
at oracle.jms.AQjmsConsumer.receiveFromAQ(AQjmsConsumer.java:916)
at oracle.jms.AQjmsConsumer.receiveFromAQ(AQjmsConsumer.java:835)
at oracle.jms.AQjmsConsumer.receive(AQjmsConsumer.java:776)
at com.evermind.server.ejb.MessageDrivenConsumer.receiveMessage(MessageDrivenConsumer.java:424)
at com.evermind.server.ejb.MessageDrivenConsumer.processMessages(MessageDrivenConsumer.java:213)
at com.evermind.server.ejb.MessageDrivenConsumer.run(MessageDrivenConsumer.java:169)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
at java.lang.Thread.run(Thread.java:595)



The program works fine if line-2 is changed from null to blank (“”) as following:

MessageProducer mp = queueSession.createProducer(queue);
ObjectMessage msg = queueSession.createObjectMessage(“”);
mp.setDeliveryMode(DeliveryMode.PERSISTENT);
mp.setTimeToLive(24 * 7 * 60 * 60 * 1000);
mp.send(msg);

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms