|
Well, if you want a radical opinion, then just
remove the DTD specification all together. Fact is, the only time you need to
validate an XML file is when you system is receiving XML dynamically from an
external source which, of coarse is how XML got started with the B2B and C2B and
all that malarkey.
If your tests prove that your database interactions
work then your hibernate xml file must be formatted correctly. No need to
revalidate everytime its loaded.
I presume you are not editing the xml file live in
production. That's always dangerous.
The more traditional opinions are:
o Place the dtd file on your web
site and use an http://localhost/....dtd
reference to get at it. Downside is that if you are running your web server in
debug mode then you are likely to only have one thread so it will lock up on
you, but works fine in production.
o You can run a separate webapp
or even a light web server to host the dtd files. There is a solution out there
that is a tiny web server that is started up from a servlet in your webapp.
Seems a little over kill but there you do.
o This is a fun one. Use the
setURLStreamHandlerFactory replacement. This allows you to define webinf: as a
protocol and make the handler do the funny tricks to resolve the file position.
Downside is that there is only one root protocol handler so it doesn't work in
WebLogic because the contains is already using it.
URL.setURLStreamHandlerFactory(new MyURLStreamHandlerFactory());
There is a library out there that will do this for
you but I can't remember its name. Clair or something silly like
that.
o Embed the DTD inside the XML
file. This is what we did on a project last year, we just ran an ant task
that merge the dtd into the xml file at build time.
----- Original Message -----
Sent: Thursday, July 14, 2005 7:20
PM
Subject: [cinjug-users] hibenate
configuration problem
Hi
I am using
hibernate for my portlet development.
In the
hibernate config file if I use the following DTD I get the refuse connect
exception for hibernate.sourcforge.net .
when I change the
location of hibernate-configuration-2.0.dtd to c:\ directory my application is
working fine.
Now I am deploying
my application to server , I need suggestions from you all on how to overcome
this problem. I am using latest version of xerces2.7.1
Pardha
|