I am trying to avoid using
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd to fetch the DTD and use a local copy. According to Hibernate documentation, I could use the DTD that is in hibernate2.jar.
When I change the DOCTYPE in my mapping file to point to that file, I get the FileNotFoundException. Hibernate docs also claims that the DTD is searched for in the CLASSPATH.
Has anyone gotton this to work? Could it be because I am using the addXML method of the configuration?
Thanks,
-ramin
Hibernate version: 2.0
Mapping documents:
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"net/sf/hibernate/hibernate-mapping-2.0.dtd" >
Full stack trace of any exception that occurs:
java.io.FileNotFoundException: /blah/dev/bin/net/sf/hibernate/hibernate-mapping-2.0.dtd (A file or directory in the path name does not exist.)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:120)
at java.io.FileInputStream.<init>(FileInputStream.java:82)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:99)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:164)
at java.net.URL.openStream(URL.java(Inlined Compiled Code))
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)(Compiled Code)
at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)(Inlined Compiled Code)
at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)(Inlined Compiled Code)
at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)(Compiled Code)
at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)(Compiled Code)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:339)
at org.dom4j.io.SAXReader.read(SAXReader.java:271)
at net.sf.hibernate.cfg.Configuration.addXML(Configuration.java:207)