Question

I want to send XML generated from an object using Springs Jaxb2marshaller and jmsTemplate.convertAndSend(object) to oracle queue (AQ). For some reason when I send the message, null is inserted into oracle queue. When I remove a few fields from that object class or those fields are null - message is delivered normally. With those fields back - again null. When debugging, I see that correct xml message is formed but have no idea why there is null in the database. No exceptions are thrown (or at least I can't find them). Any ideas?

Thank you!

Was it helpful?

Solution

The problem had nothing to do with JAXB or Spring, it was oracle queue's type. Its type was SYS.AQ$_JMS_MESSAGE which can receive messages only of type VARCHAR2, which maximum equivalent in java is 500 symbols String. When String size exceeded 500 symbols, null was enqueued.

The solution was to change AQ's type to SYS.XMLTYPE (this type of queue can receive XML's up to 4GB). Of course, message sending method had to be modified. Before sending, String which was XML had to be converted to XMLType.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top