-->
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.  [ 3 posts ] 
Author Message
 Post subject: Could not parse mapping document from resource *.hbm.xm
PostPosted: Thu Jun 05, 2008 6:52 pm 
Newbie

Joined: Thu Jun 05, 2008 6:45 pm
Posts: 2
Hi,
This is the code that i'm running:
Code:
Configuration conf = new Configuration().configure();   

This is what GlassFish returns:
Code:
configuring from resource: /hibernate.cfg.xml
Configuration resource: /hibernate.cfg.xml
Reading mappings from resource : Client.hbm.xml
Error parsing XML: XML InputStream(1) Document is invalid: no grammar found.
Error parsing XML: XML InputStream(1) Document root element "hibernate-mapping", must match DOCTYPE root "null".




This is the error i get:

Quote:
Could not parse mapping document from resource Client.hbm.xml


This is the CLient.hbm.xml

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
    <class dynamic-insert="false" dynamic-update="false" mutable="true"
    name="icmmclientsmanager.Client"
    optimistic-lock="version"
    polymorphism="implicit"
    select-before-update="false" table="Clients">
        <id column="cId" name="cid">
            <generator class="identity"/>
        </id>
        <property column="cName" name="cName"/>
        <property column="cAddress" name="cAddress"/>
    </class>
</hibernate-mapping>


And here is the hibernate.cfg.xml

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory name="session1">
        <property name="hibernate.dialect">
            org.hibernate.dialect.DerbyDialect
        </property>
        <property name="hibernate.connection.driver_class">
            com.mysql.jdbc.Driver
        </property>
        <property name="hibernate.connection.url">
            jdbc:mySql://localhost:3306/ICMMDev
        </property>
        <property name="hibernate.connection.username">
            root
        </property>
        <property name="hibernate.connection.password">
            password
        </property>
        <property name="hibernate.show_sql">
            true
        </property>
        <property name="hibernate.current_session_context_class">
            thread
        </property>
        <mapping resource="Client.hbm.xml"/>
    </session-factory>
</hibernate-configuration>


Can I get some help please? Thanks!!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 06, 2008 11:53 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
what is the exact spelling of the client mapping file?

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 06, 2008 4:47 pm 
Newbie

Joined: Thu Jun 05, 2008 6:45 pm
Posts: 2
Cameron McKenzie wrote:
what is the exact spelling of the client mapping file?


Client.hbm.xml


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