title: Hibernate error, possibly with DTD declaration
body: <p>Our project use's Hibernate's programmatic <code>Configuration</code> to set up our SessionFactory and such. I just migrated us from version 3 to version 4 of Hibernate. Now I am getting the error "Element type "hibernate-mapping" must be declared." which it says is a SaxParseException. That's great and all, but I checked my WEB-INF/lib directory and Hibernate's version 4 core .jar file is there, so it's on the classpath. </p>
  
  <p>At first I thought it's because Hibernate team migrated from </p>
  
  <pre><code>&lt;!DOCTYPE hibernate-mapping PUBLIC 
  "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"&gt;
  </code></pre>
  
  <p>to</p>
  
  <pre><code>&lt;!DOCTYPE hibernate-mapping PUBLIC 
  "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"&gt;
  </code></pre>
  
  <p>But that doesn't fix the error. What is going on? In a separate project where I am using the XML configuration file for Hibernate, I did the same migration, and it went fine. Please note that on my environment classpath must be used, the DTD cannot be downloaded from the internet or anything like that. It shouldn't be anyway.</p>
  
  <p>edit: here's the exception as requested:</p>
  
  <pre><code>Caused by: org.xml.sax.SAXParseException; systemId: ; lineNumber: 6; columnNumber: 20; Element type "hibernate-mapping" must be declared.
          at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1213)
          at org.apache.xerces.validators.common.XMLValidator.reportRecoverableXMLError(XMLValidator.java:1807)
          at org.apache.xerces.validators.common.XMLValidator.validateElementAndAttributes(XMLValidator.java:3633)
          at org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1229)
          at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:938)
          at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
          at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
  </code></pre>