-->
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: MappingException: class not found while looking for property
PostPosted: Wed Jan 04, 2006 6:16 pm 
Newbie

Joined: Wed Jan 04, 2006 6:11 pm
Posts: 3
I am getting the following mapping exception when attempting to use the composite-id in the link table created when generating a many-to-many relation between two entities.

Mapping class: com.ge.trans.iys.trains.common.relations.entities.YardTrainBlockCodeEntity -> YARD_TRAIN_BLOCK_CODE
C:\iys\views\main\iys\develop\iys\setup\build-iys-import.xml:122: Failed in building configuration when adding C:\IYS\views\main\IYS\develop\iys\components\iys-trains-server\src\com\ge\trans\iys\trains\server\mappings\YardTrainBlockCodeEntity.hbm.xml
at org.hibernate.tool.ant.ConfigurationTask.addFile(ConfigurationTask.java:145)
at org.hibernate.tool.ant.ConfigurationTask.addMappings(ConfigurationTask.java:123)
at org.hibernate.tool.ant.ConfigurationTask.doConfiguration(ConfigurationTask.java:109)
at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:55)
at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:180)
at org.hibernate.tool.ant.Hbm2DDLExporterTask.execute(Hbm2DDLExporterTask.java:39)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:144)
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.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:234)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:287)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:125)
Caused by: org.hibernate.MappingException: Could not read mapping document from file: C:\IYS\views\main\IYS\develop\iys\components\iys-trains-server\src\com\ge\trans\iys\trains\server\mappings\YardTrainBlockCodeEntity.hbm.xml
at org.hibernate.cfg.Configuration.addFile(Configuration.java:263)
at org.hibernate.tool.ant.ConfigurationTask.addFile(ConfigurationTask.java:140)
... 17 more
Caused by: org.hibernate.MappingException: class com.ge.trans.iys.trains.common.relations.entities.YardTrainBlockCodeEntity$CompositeID not found while looking for property: yardTrainKey
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:80)
at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:276)
at org.hibernate.cfg.HbmBinder.createProperty(HbmBinder.java:2064)
at org.hibernate.cfg.HbmBinder.bindComponent(HbmBinder.java:1801)
at org.hibernate.cfg.HbmBinder.bindCompositeId(HbmBinder.java:1655)
at org.hibernate.cfg.HbmBinder.bindCompositeId(HbmBinder.java:435)
at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:349)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:284)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:155)
at org.hibernate.cfg.Configuration.add(Configuration.java:379)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:418)
at org.hibernate.cfg.Configuration.addFile(Configuration.java:260)
... 18 more
Caused by: java.lang.ClassNotFoundException: com.ge.trans.iys.trains.common.relations.entities.YardTrainBlockCodeEntity$CompositeID
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at org.apache.tools.ant.module.bridge.AntBridge$MaskedClassLoader.loadClass(AntBridge.java:629)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:108)
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:76)


Top
 Profile  
 
 Post subject: This message contains the xml files for the relations
PostPosted: Wed Jan 04, 2006 6:21 pm 
Newbie

Joined: Wed Jan 04, 2006 6:11 pm
Posts: 3
The following xml file is used with JBoss 4.0 and Hibernate 3 to represent the link table.

I have created an inner class called CompositeID which resides in YardTrainBlockCodeEntity class. This is the linked entity which relates the two entities: YardTrainEntity and BlockCodeEntity.

The compiler does not have any issues and I see the CompositeID.class being created along with the YardTrainBlockCodeEntity.class

I have tried to use the Hibernate in Action - CaveatEmptor example as guidance.

XML File:

<hibernate-mapping package="com.ge.trans.iys.trains.common.relations.entities" >

<class name="YardTrainBlockCodeEntity"
table="YARD_TRAIN_BLOCK_CODE"
mutable="false"
dynamic-insert="false"
dynamic-update="false"
select-before-update="false"
optimistic-lock="version" >

<composite-id name="id" class="com.ge.trans.iys.trains.common.relations.entities.YardTrainBlockCodeEntity$CompositeID" access="field" mapped="false" unsaved-value="undefined">
<key-property name="yardTrainKey" access="field" column="YARD_TRAIN_KEY" />
<key-property name="blockCodeKey" access="field" column="BLOCK_CODE_KEY" />
</composite-id>

<version name="version"
column="VERSION"
access="org.hibernate.property.DirectPropertyAccessor"
unsaved-value="null"/>

<property name="position" column="POSITION" type="int" />

<many-to-one name="yardTrain"
column="YARD_TRAIN_KEY"
not-null="true"
access="field"
insert="false"
update="false"
unique="false"
optimistic-lock="true"
not-found="exception" />

<many-to-one name="blockCode"
column="BLOCK_CODE_KEY"
not-null="true"
access="field"
insert="false"
update="false"
unique="false"
optimistic-lock="true"
not-found="exception" />

<property name="upgrade" column="UPGRADE" type="string"/>
<property name="schemaVersion" column="SCHEMA_VERSION" type="int"/>
</class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject: Re: MappingException: class not found while looking for prop
PostPosted: Wed Jan 04, 2006 9:27 pm 
Newbie

Joined: Wed Jan 04, 2006 6:11 pm
Posts: 3
shreyas_s_shah wrote:
I am getting the following mapping exception when attempting to use the composite-id in the link table created when generating a many-to-many relation between two entities.

Please check the xml file in the following section.

Mapping class: com.ge.trans.iys.trains.common.relations.entities.YardTrainBlockCodeEntity -> YARD_TRAIN_BLOCK_CODE
C:\iys\views\main\iys\develop\iys\setup\build-iys-import.xml:122: Failed in building configuration when adding C:\IYS\views\main\IYS\develop\iys\components\iys-trains-server\src\com\ge\trans\iys\trains\server\mappings\YardTrainBlockCodeEntity.hbm.xml
at org.hibernate.tool.ant.ConfigurationTask.addFile(ConfigurationTask.java:145)
at org.hibernate.tool.ant.ConfigurationTask.addMappings(ConfigurationTask.java:123)
at org.hibernate.tool.ant.ConfigurationTask.doConfiguration(ConfigurationTask.java:109)
at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:55)
at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:180)
at org.hibernate.tool.ant.Hbm2DDLExporterTask.execute(Hbm2DDLExporterTask.java:39)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:144)
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.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:234)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:287)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:125)
Caused by: org.hibernate.MappingException: Could not read mapping document from file: C:\IYS\views\main\IYS\develop\iys\components\iys-trains-server\src\com\ge\trans\iys\trains\server\mappings\YardTrainBlockCodeEntity.hbm.xml
at org.hibernate.cfg.Configuration.addFile(Configuration.java:263)
at org.hibernate.tool.ant.ConfigurationTask.addFile(ConfigurationTask.java:140)
... 17 more
Caused by: org.hibernate.MappingException: class com.ge.trans.iys.trains.common.relations.entities.YardTrainBlockCodeEntity$CompositeID not found while looking for property: yardTrainKey
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:80)
at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:276)
at org.hibernate.cfg.HbmBinder.createProperty(HbmBinder.java:2064)
at org.hibernate.cfg.HbmBinder.bindComponent(HbmBinder.java:1801)
at org.hibernate.cfg.HbmBinder.bindCompositeId(HbmBinder.java:1655)
at org.hibernate.cfg.HbmBinder.bindCompositeId(HbmBinder.java:435)
at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:349)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:284)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:155)
at org.hibernate.cfg.Configuration.add(Configuration.java:379)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:418)
at org.hibernate.cfg.Configuration.addFile(Configuration.java:260)
... 18 more
Caused by: java.lang.ClassNotFoundException: com.ge.trans.iys.trains.common.relations.entities.YardTrainBlockCodeEntity$CompositeID
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at org.apache.tools.ant.module.bridge.AntBridge$MaskedClassLoader.loadClass(AntBridge.java:629)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:108)
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:76)


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.