Are you sending JAXB objects over JMS as javax.jms.ObjectMessage. Or are you sending the message in plain XML which is a javax.jmx.TextMessage.
eg if you send plain XML then JAXB can turn that XML into a JAXB object for you.
If you send objects over JMS then make sure the JAXB classes are on both sides, eg on the producer and consumer sides. And that they are serializable compatible. eg usually the same version/JAR etc.
I'm sending javax.jms.ObjectMessage. These objects classes are XJC generated and, since I didn't manage to get the JAXB binding generating "implements Serializable", I extended them in mine classes which ony implement serializable. I stored messages in a JMS queue after having initialized the object. The consumer retrieves messages but it finds them as if they weren't intialized. Both the producer and the consumer are in the same bundle deployed on Karaf.
Instead of extending the JAXB classes I just copied their attributes in mine ones, provided the getters/setters, implement Serializable and removed extends ...
This has solved the problem. But I don't understand why is that.
I think this is just how java serialization works.
Why not add JAXB binding to generate "implements Serializable" jaxb object?