-->
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: <hbm2hbmxml>
PostPosted: Mon Jan 14, 2008 9:05 am 
Newbie

Joined: Mon Jan 14, 2008 9:01 am
Posts: 3
When i try to generate mapping files from annotated classes i get the following error :

[hibernatetool] freemarker.core.InvalidReferenceException: Expression property.getValue().getElement().referencedEntityName is undefined on line 22, column 41 in hbm/bag.hbm.ftl.
[hibernatetool] at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
[hibernatetool] at freemarker.core.Expression.getStringValue(Expression.java:118)
[hibernatetool] at freemarker.core.Expression.getStringValue(Expression.java:93)
[hibernatetool] at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.IfBlock.accept(IfBlock.java:82)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.Environment.include(Environment.java:1375)
[hibernatetool] at freemarker.core.Include.accept(Include.java:155)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:351)
[hibernatetool] at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.Environment.include(Environment.java:1375)
[hibernatetool] at freemarker.core.Include.accept(Include.java:155)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.Environment.process(Environment.java:176)
[hibernatetool] at freemarker.template.Template.process(Template.java:232)
[hibernatetool] at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:251)
[hibernatetool] at org.hibernate.tool.hbm2x.TemplateProducer.produceToString(TemplateProducer.java:67)
[hibernatetool] at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:28)
[hibernatetool] at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:97)
[hibernatetool] at org.hibernate.tool.hbm2x.GenericExporter.exportPOJO(GenericExporter.java:146)
[hibernatetool] at org.hibernate.tool.hbm2x.GenericExporter.exportPersistentClass(GenericExporter.java:135)
[hibernatetool] at org.hibernate.tool.hbm2x.GenericExporter$2.process(GenericExporter.java:41)
[hibernatetool] at org.hibernate.tool.hbm2x.GenericExporter.doStart(GenericExporter.java:126)
[hibernatetool] at org.hibernate.tool.hbm2x.HibernateMappingExporter.doStart(HibernateMappingExporter.java:34)
[hibernatetool] at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:95)
[hibernatetool] at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:40)
[hibernatetool] at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:186)
[hibernatetool] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[hibernatetool] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[hibernatetool] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[hibernatetool] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[hibernatetool] at java.lang.reflect.Method.invoke(Method.java:585)
[hibernatetool] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
[hibernatetool] at org.apache.tools.ant.Task.perform(Task.java:348)
[hibernatetool] at org.apache.tools.ant.Target.execute(Target.java:357)
[hibernatetool] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[hibernatetool] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
[hibernatetool] at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
[hibernatetool] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[hibernatetool] at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[hibernatetool] An exception occurred while running exporter #3:hbm2hbmxml (Generates a set of hbm.xml files)
[hibernatetool] To get the full stack trace run ant with -verbose
[hibernatetool] org.hibernate.tool.hbm2x.ExporterException: Error while processing template hbm/hibernate-mapping.hbm.ftl
[hibernatetool] freemarker.core.InvalidReferenceException: Expression property.getValue().getElement().referencedEntityName is undefined on line 22, column 41 in hbm/bag.hbm.ftl.

--------------------------------
Ant Target
--------------------------------
<hibernatetool destdir="${sql.dir}">
<classpath refid="classpath"/>
<annotationconfiguration configurationfile="${basedir}/hibernate.cfg.xml" />
<hbm2ddl drop="true" create="true" export="true" outputfilename="${schema.name}" delimiter=";" format="true" />
<hbm2hbmxml destdir="${hbm.dir}" />
</hibernatetool>
--------------------------------
any help will be appreciated.

Thankx


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 14, 2008 1:19 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
1) you are probably using some specific mapping that the hbm.xml generation exporter does not support (yet). Try and locate which mapping is causing it and put it in jira.

2) why do you want to generate hbm.xml from annotations ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 14, 2008 2:02 pm 
Newbie

Joined: Mon Jan 14, 2008 9:01 am
Posts: 3
max wrote:
1) you are probably using some specific mapping that the hbm.xml generation exporter does not support (yet). Try and locate which mapping is causing it and put it in jira.
The mapping that causes the issue is : @CollectionOfElements

2) why do you want to generate hbm.xml from annotations ?


i used 2.x hibernate version, should i generate the hbm for runtime execution ?

thx


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 14, 2008 2:03 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
i'm sorry - I did not understand that text/question.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 14, 2008 2:21 pm 
Newbie

Joined: Mon Jan 14, 2008 9:01 am
Posts: 3
max wrote:
i'm sorry - I did not understand that text/question.


I used hibernate 2.0, for this version we have to provide the hbm file in the classpath in order to use the persistence object, is it still the case with the 3.x + annotation 1.5, or the annotation is sufficient to load the objects.

i hope i'am clear ;)

Thx


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 14, 2008 3:08 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hibernate 2 hbm.xml has different defaults; hibernate tools for Hibernate 3 does not generate Hibernate 2 compatible mappings..

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 06, 2008 5:47 am 
Newbie

Joined: Thu Jul 05, 2007 6:09 am
Posts: 3
max wrote:
1) you are probably using some specific mapping that the hbm.xml generation exporter does not support (yet). Try and locate which mapping is causing it and put it in jira.


I had the same problem as posted in: this topic
The problem is in the @CollectionOfElements annotation I use in my entity.

I want a hbm.xml file because this entity is used in a older project which uses hbm.xml files instead of annotations.

I put this issue in Jira


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.