Hello,
when i try to deploy my WAR-File to Tomcat 5.5, my program will only run when my internet-connection is activated and the tomcat has access to it. When i deactivate my internet connection, then my program shows errors like:
Quote:
org.hibernate.MappingException: Could not read mappings from resource: hibernateproject/Employee.hbm.xml
java.lang.NoClassDefFoundError
org.hibernate.util.DTDEntityResolver -unable to locate [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd] on classpath
here my hibernate.cfg.xml
Code:
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- Don't forget to copy your JDBC driver to the lib/ directory! -->
<!-- Settings for a local MySQL database. -->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost:3306/employeecatalog</property>
<property name="connection.username">root</property>
<property name="connection.password">moo</property>
<!--
Use the C3P0 connection pool.
<property name="c3p0.min_size">3</property>
<property name="c3p0.max_size">5</property>
<property name="c3p0.timeout">1800</property>
-->
<!-- Use the Hibernate built-in pool for tests. -->
<property name="connection.pool_size">3</property>
<!-- Print SQL to stdout. -->
<property name="show_sql">false</property>
<!-- CityCatalog mapping files. -->
<mapping resource="hibernateproject/Employee.hbm.xml"/>
</session-factory>
</hibernate-configuration>
And my mapping file Employee.hbm.xml
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping SYSTEM
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping package="hibernateproject">
<class name="Employee" table="employee" lazy="true">
<!-- We can't change the creation time, so map it with update="false". -->
<id name="idEmployee" column="idEmployee" type="java.lang.Integer">
<generator class="identity"/>
</id>
<property name="name" column="name" type="java.lang.String" update="true" not-null="true"/>
<property name="age" column="age" type="java.lang.Integer" update="true" not-null="true"/>
<property name="gendre" column="gendre" type="java.lang.String" update="true" not-null="true"/>
<property name="salary" column="salary" type="java.lang.Double" update="true" not-null="true"/>
</class>
</hibernate-mapping>
My directory-structure:
|/Tomcat5.5/webapps/hibernateWAR/index.jsp
|/Tomcat5.5/webapps/hibernateWAR/Web-Inf/
|/Tomcat5.5/webapps/hibernateWAR/Web-Inf/classes/
|/Tomcat5.5/webapps/hibernateWAR/Web-Inf/lib/
|/Tomcat5.5/webapps/hibernateWAR/Web-Inf/classes/hibernateproject/
|/Tomcat5.5/webapps/hibernateWAR/Web-Inf/classes/hibernate.cfg.xml
|/Tomcat5.5/webapps/hibernateWAR/Web-Inf/classes/log4j.properties
|/Tomcat5.5/webapps/hibernateWAR/Web-Inf/classes/hibernateproject/Employee.hbm.xml
|/Tomcat5.5/webapps/hibernateWAR/Web-Inf/classes/hibernateproject/*.class
|/Tomcat5.5/webapps/hibernateWAR/Web-Inf/lib/*.jar (mysql,hibernate3...(
Can someone please help me?