Can’t parse hibernate.cfg.xml while offline

Hibernate can resolve the DTDs locally (without a network connection).

Your DOCTYPE is using the new namespace (http://www.hibernate.org/dtd/) for Hibernate 3.6, so you might have an older version of the Hibernate libraries in your classpath.

I experienced the same issue after upgrading to Hibernate 3.6.8.Final. I had multiple versions of hibernate3.jar on the classpath causing an old incompatible version of the DTD Entity Resolver to be loaded which only works with the old namespace (http://hibernate.sourceforge.net/). For reference, here’s a link to the newer DTD Entity Resolver.

I’m using hibernate3-maven-plugin which has a transitive dependency on an older version of Hibernate so I just had to specify a plugin dependency on Hibernate 3.6.8.Final.

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
    ...
</configuration>
<dependencies>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>3.6.8.Final</version>
    </dependency>
</dependencies>
</plugin>

Leave a Comment