castor-data-binding / castor

http://castor-data-binding.github.io/castor/
35 stars 29 forks source link

ValidationMessages.properties problem with castor #68

Open matejsp opened 7 years ago

matejsp commented 7 years ago

There is a conflict with ValidationMessages.properties provided in castor-xml. According to validation specification there should be only one ValidationMessage.properties available in the classpath. However since castor-xml already includes one, after we included jasperreports in our application broke validation broke. Actually the worst part is that it works randomly on different system (due to non deterministic jar loading order).

Relevant issues: https://hibernate.atlassian.net/browse/BVAL-252 https://hibernate.atlassian.net/browse/BVAL-251 http://stackoverflow.com/questions/11599208/conflict-between-validationmessages-properties-files

Possible solution: since it is a library castor should include it's own prefixed version of ValiadtionMessage.properties. ResourceBundleLocator resourceBundleLocator = new PlatformResourceBundleLocator("CastorValidationMessages"); config.messageInterpolator(new ResourceBundleMessageInterpolator(resourceBundleLocator));

wguttmn commented 7 years ago

Sounds reasonable.