What looks like it's happening is that the marshaller tries to serialize BigDecimal
by trying to call it's empty constructor.
But BigDecimal
has no empty constructor, so the serialization mechanism catches the exception and goes on trying to serialize the BigDecimal
in another way. According to the Oracle JAX-WS documentation:
A class must have either a public zero-argument constructor or a static zero-argument factory method in order to be mapped by this annotation. One of these methods is used during unmarshalling to create an instance of the class.
So the serialization process uses another way to convert the BigDecimal, such as calling a static factory method that it knows about, because we know the serialization eventually succeeds.
It is also possible to provide to JAXB our own static factory method, that does a custom conversion. That would prevent the attempt to call the empty constructor in the first place, have a look at this answer for an example.
But the message is a debugging message, so as the marshalling works fine it can then be safely ignored, by reducing the logging level of the marshaller.