-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Hibernate website down -> dtd not available
PostPosted: Fri Jan 27, 2006 5:14 am 
Newbie

Joined: Tue Dec 27, 2005 8:02 am
Posts: 3
Location: Belgium
Apparently the dtd file specified in most configuration files (and the complete hibernate website) wasn't available this night for a couple of hours.

To make sure that in the future my programs that rely on hibernate don't crash (because of a timeout for the dtd), I would like to put the used dtd inside my jars.

But I've tried that before and failed. Just putting it in the jar and modifying the hibernate.cfg.xml to point to "hibernate-configuration-2.0.dtd" instead of "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd" didn't cut it.

Anyone knows how to get it working?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 5:20 am 
Regular
Regular

Joined: Wed Feb 02, 2005 6:33 am
Posts: 70
Which hibernate version are you using? Ensure you're using the correct dtd for your version, as by default hibernate uses a customised entity resolver that looks in the classpath for the dtd first - this is why you'll find the dtd in the hibernate[2|3].jar

If you have any problems, there are many threads covering this subject already.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 6:07 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
the dtd have always been inside hibernate.jar since the beginning of the project.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 8:59 am 
Newbie

Joined: Thu May 06, 2004 10:10 am
Posts: 14
You could also try to set your xml parsers behaviour (in server-space) to non-validating, that would get rid of the problem altogether.

I had a struts app deployed on an oracle appserver (within an intranet without internet connectivity) and the app wouldn't boot because oracle's lame-ass xml parser lib would by default try to fetch any DTD


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 9:15 am 
Newbie

Joined: Tue Dec 27, 2005 8:02 am
Posts: 3
Location: Belgium
I know it's inside the hibernate jar, and that's exactly my problem.

Here is how it is written in chapter 1 of the Hibernate Reference Documentation:
Quote:
Note that Hibernate will not load the DTD file from the web, but first look it up from the classpath of the application.


So the hibernate2 jar is inside my classpath, but if the dtd on the web is not available for whatever reasons, no connections to the database can be established for new Configuration().configure(file)

Any way to disable this xml parsing for rich clients?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 9:20 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
if you have the *correct* referenced DTD in your mapping files hibrenate will *not* try and connect externally to get it when parsing. Exactly as it states in the doc.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.