I get the following error in the stacktrace:
[hibernatetool] 23:56:25,806 ERROR Configuration:365 - Could not compile the mapping document
[hibernatetool] org.hibernate.PropertyNotFoundException: field not found: mandant
I know that there is no field mandant yet - i want hibernatetool to generate the java source with these field.
Has anyone an idea, why the code is not generated?
thanks in advance !
Hibernate version:
3.0.5
Mapping documents:
<?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="de.test.pps.VoPersonal" table="PERSONAL">
<meta attribute="class-description">Repräsentiert einen Mitarbeiter in der Test Datenbank</meta>
<composite-id>
<key-property name="mandant"></key-property>
<key-property name="personanlummer"></key-property>
</composite-id>
<property name="mandant" insert="true" access="public" type="int" column="mandant">
<meta attribute="use-in-tostring">true</meta>
</property>
<property name="personalnummer" type="int" column="PERSONALNUMMER">
<meta attribute="use-in-tostring">true</meta>
</property>
<property name="name" type="string" not-null="true">
<meta attribute="use-in-tostring">true</meta>
</property>
<many-to-one name="abteilungsnummer" class="de.test.pps.VoAbteilung" column="ABTEILUNGSNUMMER" not-null="true"/>
</class>
</hibernate-mapping>
Full stack trace of any exception that occurs:
Buildfile: C:\Programme\Java\eclipse3.1\workspace\Test\build_hibernate.xml
codegen:
[hibernatetool] Executing Hibernate Tool with a Standard Configuration
[hibernatetool] 1. task: hbm2java (Generates a set of .java files)
[hibernatetool] 23:56:23,242 INFO Environment:464 - Hibernate 3.0.5
[hibernatetool] 23:56:23,262 INFO Environment:482 - loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=org.hsqldb.jdbcDriver, hibernate.cglib.use_reflection_optimizer=true, hibernate.cache.provider_class=net.sf.hibernate.cache.EhCacheProvider, hibernate.cache.use_query_cache=true, hibernate.max_fetch_depth=1, hibernate.dialect=org.hibernate.dialect.HSQLDialect, hibernate.jdbc.use_streams_for_binary=true, hibernate.jdbc.batch_size=0, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N', hibernate.proxool.pool_alias=pool1, hibernate.connection.username=sa, hibernate.cache.region_prefix=hibernate.test, hibernate.connection.url=jdbc:hsqldb:test, hibernate.connection.password=****, hibernate.jdbc.batch_versioned_data=true, hibernate.connection.pool_size=1}
[hibernatetool] 23:56:23,282 INFO Environment:509 - using java.io streams to persist binary types
[hibernatetool] 23:56:23,282 INFO Environment:510 - using CGLIB reflection optimizer
[hibernatetool] 23:56:23,282 INFO Environment:540 - using JDK 1.4 java.sql.Timestamp handling
[hibernatetool] 23:56:23,492 INFO Configuration:1144 - configuring from file: hibernate.cfg.xml
[hibernatetool] 23:56:23,612 DEBUG DTDEntityResolver:42 - trying to locate
http://hibernate.sourceforge.net/hibern ... on-3.0.dtd in classpath under org/hibernate/
[hibernatetool] 23:56:23,622 DEBUG DTDEntityResolver:53 - found
http://hibernate.sourceforge.net/hibern ... on-3.0.dtd in classpath
[hibernatetool] 23:56:23,693 DEBUG Configuration:1067 - hibernate.connection.username=sa
[hibernatetool] 23:56:23,693 DEBUG Configuration:1067 - hibernate.dialect=org.hibernate.dialect.HSQLDialect
[hibernatetool] 23:56:23,703 DEBUG Configuration:1067 - hibernate.connection.url=jdbc:hsqldb:C:/Programme/Java/eclipse3.1/workspace/Leka/data/Test
[hibernatetool] 23:56:23,703 DEBUG Configuration:1067 - hibernate.connection.driver_class=org.hsqldb.jdbcDriver
[hibernatetool] 23:56:23,703 INFO Configuration:1222 - Configured SessionFactory: SessionFactory
[hibernatetool] 23:56:23,713 DEBUG Configuration:1223 - properties: {java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, hibernate.connection.password=, hibernate.cache.provider_class=net.sf.hibernate.cache.EhCacheProvider, sun.boot.library.path=C:\Programme\Java\jre1.5.0_02\bin, java.vm.version=1.5.0_02-b09, hibernate.proxool.pool_alias=pool1, ant.library.dir=c:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib, hibernate.connection.username=sa, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=;, hibernate.cache.use_query_cache=true, java.vm.name=Java HotSpot(TM) Client VM, file.encoding.pkg=sun.io, user.country=DE, sun.os.patch.level=Service Pack 2, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\Programme\Java\eclipse3.1\workspace\Test, java.runtime.version=1.5.0_02-b09, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.endorsed.dirs=C:\Programme\Java\jre1.5.0_02\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\DOKUME~1\BILLGA~1.LUR\LOKALE~1\Temp\, line.separator=
[hibernatetool] , java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, os.name=Windows XP, ant.home=c:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3, hibernate.jdbc.batch_versioned_data=true, hibernate.cache.region_prefix=hibernate.test, sun.jnu.encoding=Cp1252, java.library.path=C:\WINDOWS\system32;.;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Programme\ATI Technologies\ATI Control Panel;C:\PROGRA~1\IBM\CLIENT~1;C:\PROGRA~1\IBM\CLIENT~1\Shared;C:\PROGRA~1\IBM\CLIENT~1\Emulator;C:\Programme\Java\jdk1.5.0_01\bin;C:\Programme\Java\apache-ant-1.6.2\bin;C:\Programme\Gemeinsame Dateien\GTK\2.0\bin;c:\Programme\Java\eclipse3.1clean\configuration\org.eclipse.osgi\bundles\68\1\.cp, java.specification.name=Java Platform API Specification, java.class.version=49.0, hibernate.connection.pool_size=1, sun.management.compiler=HotSpot Client Compiler, os.version=5.1, user.home=C:\Dokumente und Einstellungen\Bill Gates.LURENZ, user.timezone=Europe/Berlin, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.5, hibernate.connection.driver_class=org.hsqldb.jdbcDriver, java.class.path=C:\Programme\Java\hibernate\hibernate-tools-3.0.0.alpha4a\plugins\org.hibernate.eclipse_3.0.0.alpha4\lib\log4j-1.2.9.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-antlr.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-apache-bcel.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-apache-bsf.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-apache-log4j.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-apache-oro.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-apache-regexp.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-apache-resolver.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-commons-logging.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-commons-net.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-icontract.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-jai.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-javamail.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-jdepend.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-jmf.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-jsch.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-junit.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-launcher.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-netrexx.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-nodeps.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-starteam.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-stylebook.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-swing.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-trax.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-vaj.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-weblogic.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-xalan1.jar;C:\Programme\Java\eclipse3.1clean\plugins\org.apache.ant_1.6.3\lib\ant-xslp.jar;C:\Programme\Java\hibernate\hibernate-tools-3.0.0.alpha4a\plugins\org.hibernate.eclipse_3.0.0.alpha4\lib\hibernate-tools.jar;C:\Programme\Java\hibernate\hibernate3.jar;C:\Programme\Java\hibernate\hibernate2.jar;C:\Programme\Java\hibernate\hibernate-3.0\lib\commons-logging-1.0.4.jar;C:\Programme\Java\hibernate\hibernate-3.0\lib\dom4j-1.6.jar;C:\Programme\Java\hibernate\hibernate-3.0\lib\commons-collections-2.1.1.jar;C:\Programme\Java\eclipse3.1\workspace\Test\classes;C:\Programme\Java\eclipse3.1clean\configuration\org.eclipse.osgi\bundles\8\1\.cp\lib\remoteAnt.jar;C:\Programme\Java\jdk1.5.0_02\lib\tools.jar;C:\Programme\Java\hibernate\hibernate-tools.jar;C:\Programme\Java\hibernate\hibernate2.jar;C:\Programme\Java\hibernate\hibernate3.jar;C:\Programme\Java\eclipse3.1\workspace\Test\classes;C:\Programme\Java\eclipse3.1clean\plugins\org.eclipse.swt.win32.win32.x86_3.1.0.jar, user.name=Bill Gates, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N', java.vm.specification.version=1.0, java.home=C:\Programme\Java\jre1.5.0_02, sun.arch.data.model=32, hibernate.dialect=org.hibernate.dialect.HSQLDialect, hibernate.connection.url=jdbc:hsqldb:C:/Programme/Java/eclipse3.1/workspace/Leka/data/Test, user.language=de, java.specification.vendor=Sun Microsystems Inc., awt.toolkit=sun.awt.windows.WToolkit, hibernate.cglib.use_reflection_optimizer=true, java.vm.info=mixed mode, sharing, hibernate.jdbc.use_streams_for_binary=true, java.version=1.5.0_02, java.ext.dirs=C:\Programme\Java\jre1.5.0_02\lib\ext, sun.boot.class.path=C:\Programme\Java\jre1.5.0_02\lib\rt.jar;C:\Programme\Java\jre1.5.0_02\lib\i18n.jar;C:\Programme\Java\jre1.5.0_02\lib\sunrsasign.jar;C:\Programme\Java\jre1.5.0_02\lib\jsse.jar;C:\Programme\Java\jre1.5.0_02\lib\jce.jar;C:\Programme\Java\jre1.5.0_02\lib\charsets.jar;C:\Programme\Java\jre1.5.0_02\classes, java.vendor=Sun Microsystems Inc., hibernate.jdbc.batch_size=0, file.separator=\, hibernate.session_factory_name=SessionFactory, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, sun.io.unicode.encoding=UnicodeLittle, sun.cpu.endian=little, hibernate.max_fetch_depth=1, sun.desktop=windows, sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86}
[hibernatetool] 23:56:24,323 INFO Configuration:243 - Mapping file: C:\Programme\Java\eclipse3.1\workspace\Test\src\VoPersonal.hbm.xml
[hibernatetool] 23:56:24,564 DEBUG DTDEntityResolver:42 - trying to locate
http://hibernate.sourceforge.net/hibern ... ng-3.0.dtd in classpath under org/hibernate/
[hibernatetool] 23:56:24,564 DEBUG DTDEntityResolver:53 - found
http://hibernate.sourceforge.net/hibern ... ng-3.0.dtd in classpath
[hibernatetool] 23:56:25,745 INFO HbmBinder:260 - Mapping class: de.test.pps.VoPersonal -> PERSONAL
[hibernatetool] 23:56:25,806 ERROR Configuration:365 - Could not compile the mapping document
[hibernatetool] org.hibernate.PropertyNotFoundException: field not found: mandant
[hibernatetool] at org.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:96)
[hibernatetool] at org.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:103)
[hibernatetool] at org.hibernate.property.DirectPropertyAccessor.getGetter(DirectPropertyAccessor.java:111)
[hibernatetool] at org.hibernate.util.ReflectHelper.getter(ReflectHelper.java:90)
[hibernatetool] at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:78)
[hibernatetool] at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:275)
[hibernatetool] at org.hibernate.cfg.HbmBinder.createProperty(HbmBinder.java:1841)
[hibernatetool] at org.hibernate.cfg.HbmBinder.bindComponent(HbmBinder.java:1602)
[hibernatetool] at org.hibernate.cfg.HbmBinder.bindCompositeId(HbmBinder.java:1490)
[hibernatetool] at org.hibernate.cfg.HbmBinder.bindCompositeId(HbmBinder.java:383)
[hibernatetool] at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:298)
[hibernatetool] at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:236)
[hibernatetool] at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:152)
[hibernatetool] at org.hibernate.cfg.Configuration.add(Configuration.java:362)
[hibernatetool] at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:400)
[hibernatetool] at org.hibernate.cfg.Configuration.addFile(Configuration.java:245)
[hibernatetool] at org.hibernate.tool.ant.ConfigurationTask.addFile(ConfigurationTask.java:108)
[hibernatetool] at org.hibernate.tool.ant.ConfigurationTask.addMappings(ConfigurationTask.java:91)
[hibernatetool] at org.hibernate.tool.ant.ConfigurationTask.doConfiguration(ConfigurationTask.java:77)
[hibernatetool] at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:50)
[hibernatetool] at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:150)
[hibernatetool] at org.hibernate.tool.ant.GeneratorTask.configureExporter(GeneratorTask.java:74)
[hibernatetool] at org.hibernate.tool.ant.Hbm2JavaGeneratorTask.configureExporter(Hbm2JavaGeneratorTask.java:37)
[hibernatetool] at org.hibernate.tool.ant.GeneratorTask.execute(GeneratorTask.java:32)
[hibernatetool] at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:115)
[hibernatetool] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[hibernatetool] at org.apache.tools.ant.Task.perform(Task.java:364)
[hibernatetool] at org.apache.tools.ant.Target.execute(Target.java:341)
[hibernatetool] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[hibernatetool] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[hibernatetool] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[hibernatetool] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[hibernatetool] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:416)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:138)
[hibernatetool] 23:56:25,886 ERROR Configuration:248 - Could not configure datastore from file: C:\Programme\Java\eclipse3.1\workspace\Test\src\VoPersonal.hbm.xml
[hibernatetool] org.hibernate.PropertyNotFoundException: field not found: mandant
[hibernatetool] at org.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:96)
[hibernatetool] at org.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:103)
[hibernatetool] at org.hibernate.property.DirectPropertyAccessor.getGetter(DirectPropertyAccessor.java:111)
[hibernatetool] at org.hibernate.util.ReflectHelper.getter(ReflectHelper.java:90)
[hibernatetool] at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:78)
[hibernatetool] at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:275)
[hibernatetool] at org.hibernate.cfg.HbmBinder.createProperty(HbmBinder.java:1841)
[hibernatetool] at org.hibernate.cfg.HbmBinder.bindComponent(HbmBinder.java:1602)
[hibernatetool] at org.hibernate.cfg.HbmBinder.bindCompositeId(HbmBinder.java:1490)
[hibernatetool] at org.hibernate.cfg.HbmBinder.bindCompositeId(HbmBinder.java:383)
[hibernatetool] at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:298)
[hibernatetool] at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:236)
[hibernatetool] at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:152)
[hibernatetool] at org.hibernate.cfg.Configuration.add(Configuration.java:362)
[hibernatetool] at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:400)
[hibernatetool] at org.hibernate.cfg.Configuration.addFile(Configuration.java:245)
[hibernatetool] at org.hibernate.tool.ant.ConfigurationTask.addFile(ConfigurationTask.java:108)
[hibernatetool] at org.hibernate.tool.ant.ConfigurationTask.addMappings(ConfigurationTask.java:91)
[hibernatetool] at org.hibernate.tool.ant.ConfigurationTask.doConfiguration(ConfigurationTask.java:77)
[hibernatetool] at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:50)
[hibernatetool] at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:150)
[hibernatetool] at org.hibernate.tool.ant.GeneratorTask.configureExporter(GeneratorTask.java:74)
[hibernatetool] at org.hibernate.tool.ant.Hbm2JavaGeneratorTask.configureExporter(Hbm2JavaGeneratorTask.java:37)
[hibernatetool] at org.hibernate.tool.ant.GeneratorTask.execute(GeneratorTask.java:32)
[hibernatetool] at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:115)
[hibernatetool] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[hibernatetool] at org.apache.tools.ant.Task.perform(Task.java:364)
[hibernatetool] at org.apache.tools.ant.Target.execute(Target.java:341)
[hibernatetool] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[hibernatetool] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[hibernatetool] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[hibernatetool] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[hibernatetool] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:416)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:138)
BUILD FAILED
C:\Programme\Java\eclipse3.1\workspace\Test\build_hibernate.xml:69: Failed in building configuration when adding C:\Programme\Java\eclipse3.1\workspace\Test\src\VoPersonal.hbm.xml
Total time: 4 seconds
Name and version of the database you are using:
HSQL 1.7.3
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: