Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Hibernate XML mapping validation using DTD from classpath
Hibernate XML mapping validation using DTD from classpath [message #1861869] Thu, 09 November 2023 06:16 Go to next message
Sergey Starosek is currently offline Sergey StarosekFriend
Messages: 2
Registered: November 2023
Junior Member
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.

Re: Hibernate XML mapping validation using DTD from classpath [message #1861882 is a reply to message #1861869] Fri, 10 November 2023 01:19 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4391
Registered: July 2009
Senior Member

You can open a feature request at https://github.com/eclipse-sourceediting/sourceediting , but there are a lot of questions about
how tools are supposed to handle something like this. Is the DTD even relevant at runtime? What classpath--what's it based on,
relative to, and where is the jar in such a situation?


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: Hibernate XML mapping validation using DTD from classpath [message #1861884 is a reply to message #1861882] Fri, 10 November 2023 07:12 Go to previous message
Sergey Starosek is currently offline Sergey StarosekFriend
Messages: 2
Registered: November 2023
Junior Member
Hi,

Actually what I'm looking for is to remap this specific SYSTEM DTD with classpath: prefix into local catalog. And for some reason it does not work.

It's not required that editor should look for DTD in some JAR files.

Thanks,
Sergey
Previous Topic:org.apache.cxf.cxf-core and jetty plugins giving issue missing constraint import package java.awt
Goto Forum:
  


Current Time: Sat Nov 11 05:56:31 GMT 2023

Powered by FUDForum. Page generated in 0.01905 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top