[hibernate-issues] [Hibernate-JIRA] Closed: (HBX-983) can not create POJOs file with ant and hbm2java tool

Max Rydahl Andersen (JIRA) noreply at atlassian.com
Fri Aug 24 01:54:57 EDT 2007


     [ http://opensource.atlassian.com/projects/hibernate/browse/HBX-983?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Max Rydahl Andersen closed HBX-983.
-----------------------------------

    Resolution: Rejected

your id does not have any type specified so hbm2java is trying to load the class to see if it can resolve it.

Set the type of the id.

And next time please use the forums first for usage questions.

> can not create POJOs file with ant and hbm2java tool
> ----------------------------------------------------
>
>                 Key: HBX-983
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-983
>             Project: Hibernate Tools
>          Issue Type: Bug
>          Components: hbm2java
>    Affects Versions: 3.2beta10
>         Environment: Hibernate 3.2, MySQL 5.0
>            Reporter: Hai Nguyen
>         Attachments: error.zip, errorLog, Response.hbm.xml
>
>   Original Estimate: 4 days
>  Remaining Estimate: 4 days
>
> When updating the design of database, which worked well with hbm2java and hbm2ddl, I got this issue :
> Failed in building configuration when adding C:\Documents and Settings\Hai Nguyen\workspace\laisWebv0.4\src\cz\raynet\lais\Response.hbm.xml
> [hibernatetool] org.hibernate.InvalidMappingException: Could not parse mapping document from file C:\Documents and Settings\Hai Nguyen\workspace\laisWebv0.4\src\cz\raynet\lais\Response.hbm.xml
> [hibernatetool] org.hibernate.MappingException: class cz.raynet.lais.Response not found while looking for property: id
> [hibernatetool] java.lang.ClassNotFoundException: cz.raynet.lais.Response
> Here are somethign from verbose : 
> C:\Documents and Settings\Hai Nguyen\workspace\laisWebv0.4\build.xml:76: Failed in building configuration when adding C:\Documents and Settings\Hai Nguyen\workspace\laisWebv0.4\src\cz\raynet\lais\Response.hbm.xml
> 	at org.hibernate.tool.ant.ConfigurationTask.addFile(ConfigurationTask.java:155)
> 	at org.hibernate.tool.ant.ConfigurationTask.addMappings(ConfigurationTask.java:133)
> 	at org.hibernate.tool.ant.ConfigurationTask.doConfiguration(ConfigurationTask.java:97)
> 	at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:55)
> 	at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:302)
> 	at org.hibernate.tool.ant.HibernateToolTask.getProperties(HibernateToolTask.java:318)
> 	at org.hibernate.tool.ant.ExporterTask.configureExporter(ExporterTask.java:94)
> 	at org.hibernate.tool.ant.Hbm2JavaExporterTask.configureExporter(Hbm2JavaExporterTask.java:34)
> 	at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39)
> 	at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:186)
> 	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.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
> 	at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
> 	at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:706)
> 	at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:457)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> 	at java.lang.reflect.Method.invoke(Unknown Source)
> 	at org.eclipse.ant.core.AntRunner.run(AntRunner.java:356)
> 	at org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDelegate$1.run(AntLaunchDelegate.java:230)
> 	at java.lang.Thread.run(Unknown Source)
> Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from file C:\Documents and Settings\Hai Nguyen\workspace\laisWebv0.4\src\cz\raynet\lais\Response.hbm.xml
> 	at org.hibernate.cfg.Configuration.addFile(Configuration.java:319)
> 	at org.hibernate.tool.ant.ConfigurationTask.addFile(ConfigurationTask.java:150)
> 	... 27 more
> Caused by: org.hibernate.MappingException: class cz.raynet.lais.Response not found while looking for property: id
> 	at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:74)
> 	at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:276)
> 	at org.hibernate.cfg.HbmBinder.bindSimpleId(HbmBinder.java:401)
> 	at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:334)
> 	at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:273)
> 	at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:144)
> 	at org.hibernate.cfg.Configuration.add(Configuration.java:669)
> 	at org.hibernate.cfg.Configuration.addFile(Configuration.java:309)
> 	... 28 more
> Caused by: java.lang.ClassNotFoundException: cz.raynet.lais.Response
> 	at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1166)
> 	at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1107)
> 	at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:977)
> 	at java.lang.ClassLoader.loadClass(Unknown Source)
> 	at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> 	at java.lang.Class.forName0(Native Method)
> 	at java.lang.Class.forName(Unknown Source)
> 	at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:100)
> 	at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:70)
> I use MyEclipse as the IDE, Hibernate Tools for Eclipse and Ant 3.2 beta10

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list