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>
|
|