javax.validation.ValidationException: HV000123: Unable to parse META-INF/validation.xml.

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • HV can't read validation.xml on IBM JDK, causing a failure during creation of a {{ValidatorFactory}} - the failure: {noformat} Exception in thread "main" javax.validation.ValidationException: HV000123: Unable to parse META-INF/validation.xml. at org.hibernate.validator.internal.xml.XmlParserHelper.getSchemaVersion(XmlParserHelper.java:112) at org.hibernate.validator.internal.xml.ValidationXmlParser.parseValidationXml(ValidationXmlParser.java:79) at org.hibernate.validator.internal.engine.ConfigurationImpl.getBootstrapConfiguration(ConfigurationImpl.java:287) at org.hibernate.validator.internal.engine.ConfigurationImpl.parseValidationXml(ConfigurationImpl.java:361) at org.hibernate.validator.internal.engine.ConfigurationImpl.buildValidatorFactory(ConfigurationImpl.java:214) at org.jboss.as.ee.beanvalidation.TestingApp.main(TestingApp.java:25) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55) at java.lang.reflect.Method.invoke(Method.java:495) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140) Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:181) at java.io.BufferedInputStream.reset(BufferedInputStream.java:457) at org.hibernate.validator.internal.xml.XmlParserHelper.getSchemaVersion(XmlParserHelper.java:109) ... 10 more {noformat} It looks like this is because {{XmlParserHelper}} (line 109) calls {{reset()}} on a {{xmlInputStream}} which was used for creating a {{XMLEventReader}} earlier - and for some reason, IBM JDK behaves in a way that it closes the input stream when creating a {{XMLEventReader}} out of it. So calling {{reset()}} ends with an {{IOException}}. How to reproduce - have any validation.xml on the classpath and run this code on IBM JDK: {noformat} ValidatorFactory factory = Validation.byProvider(HibernateValidator.class).configure().buildValidatorFactory(); {noformat}
    via by Jan Martiška,
  • HV can't read validation.xml on IBM JDK, causing a failure during creation of a {{ValidatorFactory}} - the failure: {noformat} Exception in thread "main" javax.validation.ValidationException: HV000123: Unable to parse META-INF/validation.xml. at org.hibernate.validator.internal.xml.XmlParserHelper.getSchemaVersion(XmlParserHelper.java:112) at org.hibernate.validator.internal.xml.ValidationXmlParser.parseValidationXml(ValidationXmlParser.java:79) at org.hibernate.validator.internal.engine.ConfigurationImpl.getBootstrapConfiguration(ConfigurationImpl.java:287) at org.hibernate.validator.internal.engine.ConfigurationImpl.parseValidationXml(ConfigurationImpl.java:361) at org.hibernate.validator.internal.engine.ConfigurationImpl.buildValidatorFactory(ConfigurationImpl.java:214) at org.jboss.as.ee.beanvalidation.TestingApp.main(TestingApp.java:25) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55) at java.lang.reflect.Method.invoke(Method.java:495) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140) Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:181) at java.io.BufferedInputStream.reset(BufferedInputStream.java:457) at org.hibernate.validator.internal.xml.XmlParserHelper.getSchemaVersion(XmlParserHelper.java:109) ... 10 more {noformat} It looks like this is because {{XmlParserHelper}} (line 109) calls {{reset()}} on a {{xmlInputStream}} which was used for creating a {{XMLEventReader}} earlier - and for some reason, IBM JDK behaves in a way that it closes the input stream when creating a {{XMLEventReader}} out of it. So calling {{reset()}} ends with an {{IOException}}. How to reproduce - have any validation.xml on the classpath and run this code on IBM JDK: {noformat} ValidatorFactory factory = Validation.byProvider(HibernateValidator.class).configure().buildValidatorFactory(); {noformat}
    via by Jan Martiška,
  • Attach the uploaded file as an email
    via Stack Overflow by user525146
    ,
  • Validate AND read with the same inputstream
    via by Unknown author,
  • Converting to Java - Java & XML Data Binding [Book]
    via by Unknown author,
  • RefleX
    via by Unknown author,
    • javax.validation.ValidationException: HV000123: Unable to parse META-INF/validation.xml. at org.hibernate.validator.internal.xml.XmlParserHelper.getSchemaVersion(XmlParserHelper.java:112) at org.hibernate.validator.internal.xml.ValidationXmlParser.parseValidationXml(ValidationXmlParser.java:79) at org.hibernate.validator.internal.engine.ConfigurationImpl.getBootstrapConfiguration(ConfigurationImpl.java:287) at org.hibernate.validator.internal.engine.ConfigurationImpl.parseValidationXml(ConfigurationImpl.java:361) at org.hibernate.validator.internal.engine.ConfigurationImpl.buildValidatorFactory(ConfigurationImpl.java:214) at org.jboss.as.ee.beanvalidation.TestingApp.main(TestingApp.java:25) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55) at java.lang.reflect.Method.invoke(Method.java:495) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140) Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:181) at java.io.BufferedInputStream.reset(BufferedInputStream.java:457) at org.hibernate.validator.internal.xml.XmlParserHelper.getSchemaVersion(XmlParserHelper.java:109) ... 10 more

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    musketyr
    musketyr1 times, last one,
    zbalint
    zbalint1 times, last one,
    20 more bugmates