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!
The problem had nothing to do with JAXB or Spring, it was oracle queue’s type. Its type was
SYS.AQ$_JMS_MESSAGEwhich can receive messages only of typeVARCHAR2, which maximum equivalent in java is 500 symbolsString. WhenStringsize 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,Stringwhich was XML had to be converted toXMLType.