-->
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: Error with mapping
PostPosted: Wed Mar 10, 2004 4:11 am 
Newbie

Joined: Fri Feb 20, 2004 10:07 am
Posts: 17
Hi
I am working on a project that requires integrating hibernate with struts.
I am using hibernate 2.1

I am getting errors mentioned below.

Pointers to solve this issue will be appreciated.

regards,
Amitabh.

++++++++++++++++++++++++++

The .hbm.xml file contents is mentioned below.
The table to be updated is "groups". There is no primary key in the groups table.

In struts config there is an action "Home".
On the browser address bar I mention

"http://localhost:8080/tmr/Home.do"

The error wrt hibernate is :

Caused by: net.sf.hibernate.MappingException: Error reading resource: com/trackmyround/enhance/group/beans/Groups.hbm.xml
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:318)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:976)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:928)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:856)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:842)
at com.browsermedia.hibernate2.HibernateConfig.initialize(HibernateConfig.java:36)
... 36 more
Caused by: net.sf.hibernate.MappingException: duplicate import: Groups
at net.sf.hibernate.cfg.Mappings.addImport(Mappings.java:85)
at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:126)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:221)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1229)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:249)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:285)
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:315)
... 41 more



--------------------------------------------------------------------------------

Apache Tomcat/4.1.24

>>>>>>>>>>>>>>>>>>>>>

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>

<class name="com.trackmyround.enhance.group.beans.Groups" table="groups">


<id name="id">
<generator class="identity">
</generator>
</id>

<property name="groupID" type="int" column="GROUP_ID" not-null="true"/>


<property name="memberID" type="int" column="MEMBER_ID" not-null="true"/>

<property name="joinDate" type="date" column="JOIN_DATE" not-null="true"/>

</class>

</hibernate-mapping>


Top
 Profile  
 
 Post subject: checked further
PostPosted: Wed Mar 10, 2004 7:04 am 
Newbie

Joined: Fri Feb 20, 2004 10:07 am
Posts: 17
This is the error I get when I try to use use the .hbm files.

Is it possible that the same class is loaded twice and hence there is a name space issue?

regards,
Amitabh.


Caused by: net.sf.hibernate.MappingException: duplicate import: GroupMaster
at net.sf.hibernate.cfg.Mappings.addImport(Mappings.java:85)
at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:126)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:221)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1229)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:249)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:285)
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:315)
... 41 more


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 10, 2004 5:05 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
This is usually related to a mapping issue in general.
Try to use the lastest 2.1.2 and check the logs for any issue in parsing

_________________
Emmanuel


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.