Hi All,
Hibernate 5.5.6 (and probably other versions) supports offline validation of the mappings given that XML DTD defined as:
<!DOCTYPE hibernate-mapping
SYSTEM "classpath://org/hibernate/hibernate-mapping-3.0.dtd">
(see DTDEntityResolver and LocalXmlResourceResolver in https://github.com/hibernate/hibernate-orm/tree/main/hibernate-core)
This works as expected in production but editing of mappings in the Eclipse is painful as the DTD cannot be found.
I've extracted DTDs from the Hibernate JAR, added them to the project and I tried to add user entries to the XML Catalog (tried both catalog and rewrite entries) but no success. Looks like classpath: prefix is not supported.
XML Editor is full of errors and there are two on the line with DTD declaration:
Multiple annotations found at this line:
- The file cannot be validated as the XML definition "/home/star/projects/AlfaLab/src/ISYS/src/java/classpath:/org/
hibernate/hibernate-mapping-3.0.dtd (No such file or directory)" that is specified as describing the syntax of the file cannot be
located.
- Cannot find DTD 'classpath://org/hibernate/hibernate-mapping-3.0.dtd'.
I'm using Eclipse Version: 2023-09 (4.29.0) and WTP 3.31 (Eclipse XML Editors and Tools Version: 3.31.0.v202308200343).
Any ideas how to solve this problem? I'd prefer to keep current DTD declaration and do some changes to Eclipse configuration instead of using PUBLIC DTD and replacing it during packaging.
Thanks.