You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 5, 2019. It is now read-only.
I was testing the JAXB Unmarshalling feature, and I could find that after this improvement an errorCounter was added for throwing a generic exception after ten unmarshalling errors.
This behaviour can be easily reproduced with this test case (if needed, clone the repository and run mvn clean install).
However I think this behavior has some limitations and a better approach could be taken.
If you need to use JAXB to unmarshall differents xml files in differents scenarios, after the tenth try, you will only have an unclear and generic exception with the following message:
Errors limit exceeded. To receive all errors set com.sun.xml.bind logger to FINEST level.
This message doesn't have any information about the unmarshalling. The traceability of the error is very poor! I know that the case that caused this improvement was about an scenario where the same xml was unmarshalled many times but scenarios where differents xml are unmarshalled should also be considered. It is also important because the JaxbException is propagated in frameworks like CXF, and after the tenth try, the final user can't get a clear exception.
I also know a workaround could be setting the log level to FINEST, but it results in a verbose logging as a side effect.
I have read that the improvement was caused by a performance problem in that the exception message was formatted over and over, but a caching strategy could be a better approach to avoid formatting identical messages more than once.
Lastly, It would be nice, at least, to able to configure if an error limit should be applied through the API or a system property instead through the log level.
Thanks and Regards.
The text was updated successfully, but these errors were encountered:
Hi Guys.
I was testing the JAXB Unmarshalling feature, and I could find that after this improvement an errorCounter was added for throwing a generic exception after ten unmarshalling errors.
This behaviour can be easily reproduced with this test case (if needed, clone the repository and run mvn clean install).
However I think this behavior has some limitations and a better approach could be taken.
If you need to use JAXB to unmarshall differents xml files in differents scenarios, after the tenth try, you will only have an unclear and generic exception with the following message:
This message doesn't have any information about the unmarshalling. The traceability of the error is very poor! I know that the case that caused this improvement was about an scenario where the same xml was unmarshalled many times but scenarios where differents xml are unmarshalled should also be considered. It is also important because the JaxbException is propagated in frameworks like CXF, and after the tenth try, the final user can't get a clear exception.
I also know a workaround could be setting the log level to FINEST, but it results in a verbose logging as a side effect.
I have read that the improvement was caused by a performance problem in that the exception message was formatted over and over, but a caching strategy could be a better approach to avoid formatting identical messages more than once.
Lastly, It would be nice, at least, to able to configure if an error limit should be applied through the API or a system property instead through the log level.
Thanks and Regards.
The text was updated successfully, but these errors were encountered: