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.  [ 2 posts ] 
Author Message
 Post subject: Need Help in deploying WAR with Tomcat 5.5
PostPosted: Mon Jul 31, 2006 7:00 pm 
Regular
Regular

Joined: Mon Jul 31, 2006 4:59 pm
Posts: 53
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?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 01, 2006 4:42 am 
Expert
Expert

Joined: Thu Sep 22, 2005 10:29 am
Posts: 285
Location: Almassera/Valencia/Spain/EU/Earth/Solar system/Milky Way/Local Group/Virgo Supercluster
You have to change your doctype declaration of your hbm.xml files:
Code:
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.