seam-gen error
pbrewer_uk Feb 7, 2007 10:06 AMI've just started looking at seam-gen (with Seam 1.1.5 and Oracle XE) and it fails when running the generate-entites task. It manages to build all the entity beans, but breaks half way through building the xxxList.xhtml pages (it does output about 10 files of an expected 40).
The error message is:
... [hibernate] 2. task: generic exportertemplate: view/list.xhtml.ftl 07-Feb-2007 14:43:32 org.hibernate.connection.DriverManagerConnectionProvider close INFO: cleaning up connection pool: jdbc:oracle:thin:@localhost:1521:XE [hibernate] 07-Feb-2007 14:43:33 freemarker.log.JDK14LoggerFactory$JDK14Logger error [hibernate] SEVERE: [hibernate] Expression property.value.typeName is undefined on line 30, column 6 in view/list.xhtml.ftl. [hibernate] The problematic instruction: [hibernate] ---------- [hibernate] ==> if property.value.typeName == "string" [on line 30, column 1 in view/list.xhtml.ftl] [hibernate] ---------- [hibernate] Java backtrace for programmers: [hibernate] ---------- [hibernate] freemarker.core.InvalidReferenceException: Expression property.value.typeName is undefined on line 30, column 6 in view/list.xhtml.ftl. [hibernate] at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124) [hibernate] at freemarker.core.ComparisonExpression.isTrue(ComparisonExpression.java:121) [hibernate] at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:77) [hibernate] at freemarker.core.Environment.visit(Environment.java:196) [hibernate] at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79) [hibernate] at freemarker.core.Environment.visit(Environment.java:196) [hibernate] at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160) [hibernate] at freemarker.core.Environment.visit(Environment.java:351) [hibernate] at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95) [hibernate] at freemarker.core.Environment.visit(Environment.java:196) [hibernate] at freemarker.core.MixedContent.accept(MixedContent.java:92) [hibernate] at freemarker.core.Environment.visit(Environment.java:196) [hibernate] at freemarker.core.Environment.process(Environment.java:176) [hibernate] at freemarker.template.Template.process(Template.java:231) [hibernate] at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:247) [hibernate] at org.hibernate.tool.hbm2x.TemplateProducer.produceToString(TemplateProducer.java:67) [hibernate] at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:28) [hibernate] at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:97) [hibernate] at org.hibernate.tool.hbm2x.GenericExporter.exportPOJO(GenericExporter.java:84) [hibernate] at org.hibernate.tool.hbm2x.GenericExporter.exportPersistentClass(GenericExporter.java:73) [hibernate] at org.hibernate.tool.hbm2x.GenericExporter.exportClasses(GenericExporter.java:56) [hibernate] at org.hibernate.tool.hbm2x.GenericExporter.doStart(GenericExporter.java:41) [hibernate] at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:95) [hibernate] at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:40) [hibernate] at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:182) [hibernate] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) [hibernate] at org.apache.tools.ant.Task.perform(Task.java:364) [hibernate] at org.apache.tools.ant.Target.execute(Target.java:341) [hibernate] at org.apache.tools.ant.Target.performTasks(Target.java:369) [hibernate] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216) [hibernate] at org.apache.tools.ant.Project.executeTarget(Project.java:1185) [hibernate] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40) [hibernate] at org.apache.tools.ant.Project.executeTargets(Project.java:1068) [hibernate] at org.apache.tools.ant.Main.runBuild(Main.java:668) [hibernate] at org.apache.tools.ant.Main.startAnt(Main.java:187) [hibernate] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246) [hibernate] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67) [hibernate] An exception occurred while running exporter #3:generic exportertemplate: view/list.xhtml.ftl [hibernate] To get the full stack trace run ant with -verbose [hibernate] org.hibernate.tool.hbm2x.ExporterException: Error while processing template view/list.xhtml.ftl [hibernate] freemarker.core.InvalidReferenceException: Expression property.value.typeName is undefined on line 30, column 6 in view/list.xhtml.ftl. BUILD FAILED \jboss-seam-1.1.5.GA\seam-gen\build.xml:785: org.hibernate.tool.hbm2x.ExporterException: Error while processing template view/list.xhtml.ftl at org.hibernate.tool.ant.HibernateToolTask.reportException(HibernateToolTask.java:222) at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:185) 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) Caused by: org.hibernate.tool.hbm2x.ExporterException: Error while processing template view/list.xhtml.ftl at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:253) at org.hibernate.tool.hbm2x.TemplateProducer.produceToString(TemplateProducer.java:67) at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:28) at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:97) at org.hibernate.tool.hbm2x.GenericExporter.exportPOJO(GenericExporter.java:84) at org.hibernate.tool.hbm2x.GenericExporter.exportPersistentClass(GenericExporter.java:73) at org.hibernate.tool.hbm2x.GenericExporter.exportClasses(GenericExporter.java:56) at org.hibernate.tool.hbm2x.GenericExporter.doStart(GenericExporter.java:41) at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:95) at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:40) at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:182) ... 12 more Caused by: freemarker.core.InvalidReferenceException: Expression property.value.typeName is undefined on line 30, column 6 in view/list.xhtml.ftl. at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124) at freemarker.core.ComparisonExpression.isTrue(ComparisonExpression.java:121) at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:77) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160) at freemarker.core.Environment.visit(Environment.java:351) at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.Environment.process(Environment.java:176) at freemarker.template.Template.process(Template.java:231) at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:247) ... 22 more --- Nested Exception --- org.hibernate.tool.hbm2x.ExporterException: Error while processing template view/list.xhtml.ftl at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:253) at org.hibernate.tool.hbm2x.TemplateProducer.produceToString(TemplateProducer.java:67) at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:28) at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:97) at org.hibernate.tool.hbm2x.GenericExporter.exportPOJO(GenericExporter.java:84) at org.hibernate.tool.hbm2x.GenericExporter.exportPersistentClass(GenericExporter.java:73) at org.hibernate.tool.hbm2x.GenericExporter.exportClasses(GenericExporter.java:56) at org.hibernate.tool.hbm2x.GenericExporter.doStart(GenericExporter.java:41) at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:95) at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:40) at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:182) 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) Caused by: freemarker.core.InvalidReferenceException: Expression property.value.typeName is undefined on line 30, column 6 in view/list.xhtml.ftl. at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124) at freemarker.core.ComparisonExpression.isTrue(ComparisonExpression.java:121) at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:77) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160) at freemarker.core.Environment.visit(Environment.java:351) at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.Environment.process(Environment.java:176) at freemarker.template.Template.process(Template.java:231) at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:247) ... 22 more
The part it's compaining about is in the for loop:
<#foreach property in pojo.allPropertiesIterator> <#if !c2h.isCollection(property) && !c2h.isManyToOne(property)> <#if property.value.typeName == "string"><#-- IT BREAKS ON THIS LINE --> <tr class="prop"> <td class="name">${property.name}</td> <td class="value"> <h:inputText id="${property.name}" value="${'#'}{${listName}.${componentName}.${property.name}}"/> </td> </tr> </#if> </#if> </#foreach>
I've tried changing the breaking line to the following, but freemarker complains about my syntax.
<#if (property.value.typeName)?? && property.value.typeName == "string">
Any ideas on why its throwing an exception or how to fix it would be greatly recieved.
Thanks in advance, Pete