-->
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.  [ 6 posts ] 
Author Message
 Post subject: Problem with hbm2java in Hibernate 3.1.0 alpha 5 tools
PostPosted: Sat Sep 03, 2005 7:48 am 
Newbie

Joined: Sat Sep 03, 2005 6:31 am
Posts: 7
Hi ,

I am new to Hibernate, and using Hibernate 3.1 beta 2., with Hibernate Tools-3.1.0.alpha5.

The following is my mapping document.

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

<class name="Class1" table="Table1" lazy="true">
<id name="id" type="long" column="ID" >
<generator class="native" />
</id>
<property name="siteId" type="string" column="SITE_ID" not-null="true" unique="true" length="2" />
<property name="siteName" type="string" column="SITE_NAME" not-null="true" length="30" />
<property name="siteNumber" type="int" column="SITE_NO" not-null="true" unique="true" length="3" />
<property name="siteType" type="char" column="SITE_TYPE" not-null="true" />
<property name="siteDbLink" type="string" column="SITE_DBLINK" not-null="true" length="50" />
<property name="isFunctional" type="char" column="FUNCTIONAL_YN" not-null="true" />
</class>

<class name="Class2" table="Table2" lazy="true">
<id name="id" type="long" column="ID" >
<generator class="native" />
</id>
<many-to-one name="siteId" column="SITE_ID" class="Class1" property-ref="siteId" lazy="proxy"/>
<property name="workstationBased" type="char" column="WS_BY_IP_NAME" not-null="true" />
<property name="changeWorkstation" type="char" column="CHANGE_WS_AT_FCY_YN" not-null="true" />
<list name="list" table="Table3">
<meta attribute="field-description">Facilities Acesssible by this user</meta>
<key property-ref="siteId" column="SITE_ID" />
<list-index column="SITE_INDEX" />
<composite-element class="Class3">
<many-to-one name="otherSiteId" class="Class1" column="OTHER_SITE_ID" property-ref="siteId" lazy="proxy"/>
<property name="remarks" type="string" column="REMARKS" length="200" />
</composite-element>
</list>
</class>
</hibernate-mapping>
**************************************End Hibernate Mapping Document**************************************

I am using org.hibernate.tool.ant.HibernateToolTask, with <hbm2java/> for code generation. In the process of code generation I am getting java.util.ConcurrentModificationException.

Am I doing something wrong here ?? Any help is greatly appreciated.

Thanks in Advance
ChandraSekhar


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 03, 2005 11:11 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
more info please...show full stack trace ...

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Stack Trace Pasted
PostPosted: Sun Sep 04, 2005 11:57 pm 
Newbie

Joined: Sat Sep 03, 2005 6:31 am
Posts: 7
Stack Trace is pasted below..

[hibernatetool] 09:25:50,703 DEBUG CollectionSecondPass:33 - Second pass for collection: Class2.list
[hibernatetool] 09:25:50,703 DEBUG HbmBinder:1214 - Mapped property: otherSiteId -> OTHER_SITE_ID
[hibernatetool] 09:25:50,703 DEBUG HbmBinder:1214 - Mapped property: remarks -> REMARKS
[hibernatetool] 09:25:50,703 DEBUG CollectionSecondPass:49 - Mapped collection key: SITE_ID, index: SITE_INDEX, element: OTHER_SITE_ID, REMARKS

BUILD FAILED

D:\chandra\persistence_tools\test\build.xml:31: java.util.ConcurrentModificationException
at org.apache.tools.ant.Task.perform(Task.java:373)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: java.util.ConcurrentModificationException
at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:448)
at java.util.AbstractList$Itr.remove(AbstractList.java:433)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1005)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:969)
at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:51)
at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:158)
at org.hibernate.tool.ant.GeneratorTask.configureExporter(GeneratorTask.java:73)
at org.hibernate.tool.ant.Hbm2JavaGeneratorTask.configureExporter(Hbm2JavaGeneratorTask.java:37)
at org.hibernate.tool.ant.GeneratorTask.execute(GeneratorTask.java:31)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:122)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
... 10 more
--- Nested Exception ---
java.util.ConcurrentModificationException
at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:448)
at java.util.AbstractList$Itr.remove(AbstractList.java:433)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1005)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:969)
at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:51)
at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:158)
at org.hibernate.tool.ant.GeneratorTask.configureExporter(GeneratorTask.java:73)
at org.hibernate.tool.ant.Hbm2JavaGeneratorTask.configureExporter(Hbm2JavaGeneratorTask.java:37)
at org.hibernate.tool.ant.GeneratorTask.execute(GeneratorTask.java:31)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:122)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)

Total time: 2 seconds


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 05, 2005 12:40 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
this is weird.

please put it in jira with jdk info et,al

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 05, 2005 1:10 am 
Newbie

Joined: Sat Sep 03, 2005 6:31 am
Posts: 7
Added Issue in the JIRA hope the information is sufficient and the key is HBX-395

thanks and regards
chandrasekhar


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 05, 2005 3:33 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
I moved it since the mappings are either incorrect or not-supported - either way, we should have a better exception.

http://opensource2.atlassian.com/projec ... se/HHH-936

_________________
Max
Don't forget to rate


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