-->
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.  [ 7 posts ] 
Author Message
 Post subject: I am getting org.hibernate.DuplicateMappingException
PostPosted: Tue Aug 01, 2006 8:28 am 
Newbie

Joined: Tue Aug 01, 2006 8:22 am
Posts: 6
Location: hyderabad
hi,

I am getting this Exception when i try to access DAO which will generate some operation on the database. can any one help me in this regard

org.hibernate.MappingException: Could not read mappings from resource: org/campuseai/crm/hibernate/MemberInformation.hbm.xml

at org.hibernate.cfg.Configuration.addResource(Configuration.java:485)

at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1465)

at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1433)

at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1414)

at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1390)

at org.hibernate.cfg.Configuration.configure(Configuration.java:1310)

at org.campuseai.crm.utils.HibernateSessionFactory.currentSession(HibernateSessionFactory.java:48)

at org.campuseai.crm.hibernate.StaffInfoDAO.findByExample(StaffInfoDAO.java:60)

at _htdocs._crm._BusinessSearch._jspService(BusinessSearch.jsp:435)

at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:57)

at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:347)

at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)

at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)

at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)

at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:649)

at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)

at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:251)

at oracle.portal.provider.v2.render.http.AbstractResourceRenderer.renderBody(Unknown Source)

at oracle.portal.provider.v2.render.RenderManager.render(Unknown Source)

at oracle.portal.provider.v2.DefaultPortletInstance.render(Unknown Source)

at oracle.webdb.provider.v2.adapter.soapV1.ProviderAdapter.showPortlet(Unknown Source)

at oracle.webdb.provider.v2.adapter.soapV1.ProviderAdapter.handleHttp(Unknown Source)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java)

at oracle.webdb.provider.v2.adapter.SOAPServlet.doHTTPCall(Unknown Source)

at oracle.webdb.provider.v2.adapter.SOAPServlet.service(Unknown Source)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)

at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)

at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:649)

at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)

at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)

at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)

at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)

at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)

at java.lang.Thread.run(Thread.java:534)

Caused by: org.hibernate.DuplicateMappingException: Duplicate collection role mapping org.campuseai.crm.hibernate.MemberInformation.contactInformations

at org.hibernate.DuplicateMappingException.<init>(DuplicateMappingException.java:16)

at org.hibernate.cfg.Mappings.addCollection(Mappings.java:124)

at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2030)

at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2006)

at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:368)

at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:283)

at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:153)

at org.hibernate.cfg.Configuration.add(Configuration.java:386)

at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:427)

at org.hibernate.cfg.Configuration.addResource(Configuration.java:482)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 01, 2006 8:31 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
post MemberInformation.hbm.xml


Top
 Profile  
 
 Post subject: MemberInformation.hbm.xml
PostPosted: Tue Aug 01, 2006 10:46 am 
Newbie

Joined: Tue Aug 01, 2006 8:22 am
Posts: 6
Location: hyderabad
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--
Generated by SV Sesharaju - CRM Project Team member - CampusEAI Consortium
-->
<hibernate-mapping>
<class name="org.campuseai.crm.hibernate.MemberInformation" table="MEMBER_INFORMATION" schema="CRM">
<id name="instituteId" type="long">
<column name="INSTITUTE_ID" precision="4" scale="0" />
<generator class="sequence">
<param name="sequence" >institute_id_seq</param>
</generator>

</id>
<many-to-one name="staffInfo" class="org.campuseai.crm.hibernate.StaffInfo" fetch="select">
<column name="LAST_MODIFIED_BY" length="10" />
</many-to-one>
<many-to-one name="phaseTable" class="org.campuseai.crm.hibernate.PhaseTable" fetch="select">
<column name="CURRENT_PHASE" precision="3" scale="0" />
</many-to-one>
<property name="instituteCode" type="string">
<column name="INSTITUTE_CODE" length="8" unique="true" />
</property>
<property name="instituteName" type="string">
<column name="INSTITUTE_NAME" length="150" />
</property>
<property name="instituteAcronym" type="string">
<column name="INSTITUTE_ACRONYM" length="8" />
</property>
<property name="instituteAddress" type="string">
<column name="INSTITUTE_ADDRESS" length="500" />
</property>
<property name="instituteCity" type="string">
<column name="INSTITUTE_CITY" length="50" />
</property>
<property name="instituteState" type="string">
<column name="INSTITUTE_STATE" length="50" />
</property>
<property name="instituteCountry" type="string">
<column name="INSTITUTE_COUNTRY" length="50" />
</property>
<property name="instituteZipcode" type="long">
<column name="INSTITUTE_ZIPCODE" precision="15" scale="0" />
</property>
<property name="instituteRepresentative" type="string">
<column name="INSTITUTE_REPRESENTATIVE" length="100" />
</property>
<property name="firstName" type="string">
<column name="FIRST_NAME" length="150" />
</property>
<property name="lastName" type="string">
<column name="LAST_NAME" length="150" />
</property>
<property name="fax" type="long">
<column name="FAX" precision="12" scale="0" />
</property>
<property name="phone" type="long">
<column name="PHONE" precision="12" scale="0" />
</property>
<property name="cellNo" type="long">
<column name="CELL_NO" precision="12" scale="0" />
</property>
<property name="email" type="string">
<column name="EMAIL" length="150" />
</property>
<property name="joiningDate" type="date">
<column name="JOINING_DATE" length="7" />
</property>
<property name="releaseDate" type="date">
<column name="RELEASE_DATE" length="7" />
</property>
<property name="compaign" type="string">
<column name="COMPAIGN" length="250" />
</property>
<property name="productionDate" type="date">
<column name="PRODUCTION_DATE" length="7" />
</property>
<property name="status" type="string">
<column name="STATUS" length="1" />
</property>
<property name="statusNotes" type="string">
<column name="STATUS_NOTES" length="1000" />
</property>
<property name="lastModifiedDate" type="date">
<column name="LAST_MODIFIED_DATE" length="7" />
</property>
<property name="isDeleted" type="string">
<column name="IS_DELETED" length="1" />
</property>
<set name="contactInformations" inverse="true">
<key>
<column name="INSTITUTE_ID" precision="4" scale="0" not-null="true" />
</key>
<one-to-many class="org.campuseai.crm.hibernate.ContactInformation" />
</set>
<set name="businessContactLogs" inverse="true">
<key>
<column name="INSTITUTE_ID" precision="4" scale="0" />
</key>
<one-to-many class="org.campuseai.crm.hibernate.BusinessContactLog" />
</set>
<set name="productDetailses" inverse="true">
<key>
<column name="INSTITUTE_ID" precision="4" scale="0" not-null="true" />
</key>
<one-to-many class="org.campuseai.crm.hibernate.ProductDetails" />
</set>
<set name="memberInformationLogs" inverse="true">
<key>
<column name="INSTITUTE_ID" precision="4" scale="0" not-null="true" />
</key>
<one-to-many class="org.campuseai.crm.hibernate.MemberInformationLog" />
</set>
<set name="meetingDetailses" inverse="true">
<key>
<column name="INSTITUTE_ID" precision="4" scale="0" not-null="true" />
</key>
<one-to-many class="org.campuseai.crm.hibernate.MeetingDetails" />
</set>
<set name="infrastructureDetailses" inverse="true">
<key>
<column name="INSTITUTE_ID" precision="4" scale="0" not-null="true" />
</key>
<one-to-many class="org.campuseai.crm.hibernate.InfrastructureDetails" />
</set>
<set name="businessContacts" inverse="true">
<key>
<column name="INSTITUTE_ID" precision="4" scale="0" />
</key>
<one-to-many class="org.campuseai.crm.hibernate.BusinessContact" />
</set>
</class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 01, 2006 10:51 am 
Newbie

Joined: Tue Aug 01, 2006 8:22 am
Posts: 6
Location: hyderabad
i have posted the memberinformation.hbm.xml


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 01, 2006 4:44 pm 
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
post ContactInformation.hbm.xml


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 02, 2006 2:00 am 
Newbie

Joined: Tue Aug 01, 2006 8:22 am
Posts: 6
Location: hyderabad
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--
Generated by SV Sesharaju - CRM Project Team member - CampusEAI Consortium
-->
<hibernate-mapping>
<class name="org.campuseai.crm.hibernate.ContactInformation" table="CONTACT_INFORMATION" schema="CRM">
<composite-id name="id" class="org.campuseai.crm.hibernate.ContactInformationId">
<key-many-to-one name="memberInformation" class="org.campuseai.crm.hibernate.MemberInformation">
<column name="INSTITUTE_ID" precision="4" scale="0" />
</key-many-to-one>
<key-property name="contactId" type="long">
<column name="CONTACT_ID" precision="4" scale="0" />
<generator class="sequence">
<param name="sequence" >contact_id_seq</param>
</generator>

</key-property>
</composite-id>
<many-to-one name="staffInfo" class="org.campuseai.crm.hibernate.StaffInfo" fetch="select">
<column name="LAST_MODIFIED_BY" length="10" />
</many-to-one>
<property name="firstName" type="string">
<column name="FIRST_NAME" length="150" />
</property>
<property name="lastName" type="string">
<column name="LAST_NAME" length="150" />
</property>
<property name="address" type="string">
<column name="ADDRESS" length="500" />
</property>
<property name="city" type="string">
<column name="CITY" length="50" />
</property>
<property name="state" type="string">
<column name="STATE" length="50" />
</property>
<property name="country" type="string">
<column name="COUNTRY" length="50" />
</property>
<property name="zipcode" type="long">
<column name="ZIPCODE" precision="15" scale="0" />
</property>
<property name="fax" type="long">
<column name="FAX" precision="12" scale="0" />
</property>
<property name="phone" type="long">
<column name="PHONE" precision="12" scale="0" />
</property>
<property name="cellno" type="long">
<column name="CELLNO" precision="12" scale="0" />
</property>
<property name="email" type="string">
<column name="EMAIL" length="150" />
</property>
<property name="designation" type="string">
<column name="DESIGNATION" length="100" />
</property>
<property name="comments" type="string">
<column name="COMMENTS" length="500" />
</property>
<property name="lastModifiedDate" type="date">
<column name="LAST_MODIFIED_DATE" length="7" />
</property>
<property name="isDeleted" type="string">
<column name="IS_DELETED" length="1" />
</property>
<set name="contactInformationLogs" inverse="true">
<key>
<column name="INSTITUTE_ID" precision="4" scale="0" not-null="true" />
<column name="CONTACT_ID" precision="4" scale="0" not-null="true" />
</key>
<one-to-many class="org.campuseai.crm.hibernate.ContactInformationLog" />
</set>
</class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 02, 2006 3:04 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 can't have a generator in a composite-id.


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