My problem is that there is no way to have Hibernate not call setValidate(true) on the Dom4J SAXReader created in the org.hibernate.util.XMLHelper, line 39 which is needed to use the non-validating XML parser Piccolo.
To see the problem, get a system working with Xerces. Then download Piccolo from
http://piccolo.sourceforge.net/index.html and add -Djavax.xml.parsers.SAXParserFactory=com.bluecast.xml.JAXPSAXParserFactory to your startup parameters.
I've patched the local copy of my source to set validation to false and am not seeing any negative impacts of this change.
Two questions:
1. Are there any negative side effects to this that I'm not seeing? Is validation required for some feature I'm not using?
2. What would be the Hibernate-appropriate way to pass the validation flag as a parameter? Seems like Configuration.setProperty would be the most approriate way. Any conventions on property names?
Thanks for your time,
Randy
Hibernate version: 3.0.5
Mapping documents: Any
Code between sessionFactory.openSession() and session.close(): Error occurs on configure, before openSession
Full stack trace of any exception that occurs:
Code:
Nested exception:
org.xml.sax.SAXNotSupportedException: validation is not supported
at com.bluecast.xml.Piccolo.setFeature(Piccolo.java:922)
at org.dom4j.io.SAXReader.configureReader(SAXReader.java:944)
at org.dom4j.io.SAXReader.read(SAXReader.java:463)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1168)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1146)
Name and version of the database you are using: Any (seen with HSML and MySQL)
The generated SQL (show_sql=true): None.
Debug level Hibernate log excerpt: