in the typical hibernate configuration XML we have a doctype specification:
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
i am finding that this URI:
http://hibernate.sourceforge.net/hibern ... on-3.0.dtd
times out quite often, intermittently (but regularly) fails to be found. (it also can take a long time to load, making even a simple editor save an expensive proposition, but that's another rant.) this breaks us at XML edit time, this breaks us at test environment startup time, and etc, and the error generated out of the SAX parser at test environment runtime is extremely cryptic.
our IDE is WSAD 5.1.
i want to retain this validation at edit time, but at runtime i would consider it "optional".
i have tried specifying a SYSTEM doctype id, pointed at the local file system (relative to where we want to version the DTD), and at build time i bundle the DTDs into jars where they could be found as resources on the classpath at test environment runtime. however, while this works at XML edit time, at test environment runtime, the SAX parser doesn't seem to want to use the runtime classpath to find these DTDs for validation, it wants to use the test environment's working directory (i.e. the place WSAD runs out of as an IDE application).
so, i thought: just turn validation off at test environment runtime, rely purely on edit-time validation, using our XML IDE and a local copy of the DTD (i.e. change to a SYSTEM id referencing a copy of the DTD versioned right alongside the configuration file). however, i have examined the interface for class org.hibernate.cfg.Configuration, and i don't see a way to do this (turn off validation).
can anyone suggest any sort of workaround? a way to specify (in a DOCTYPE id) a URI on the classpath might work, and i am assuming a way to disable validation at runtime would definitely work. anyway, we need some way to cache this DTD locally, and deploy it with the application without having to jump through hoops, or ignore it at runtime.