8 Replies Latest reply on Feb 17, 2007 9:44 PM by Saeed Iqbal

    Seam Gen template error?

    Damian Harvey Master

      (This is a bit pedantic but thought it belonged here anyway)

      If you have a ManyToOne association that goes more than one level deep eg. A PERSON associated with a COMPANY associated with a COUNTRY then the SeamGen view template has a small error on line 83 of the view.xhtml.ftl

      It is currently:

      ${'#'}{${parentName}.${parentProperty.name}.${parentPojo.identifierProperty.name}}

      but should be:
      ${'#'}{${parentName}.${parentProperty.name}.${parentParentPojo.identifierProperty.name}}


      It results in an error in the generated View page as the property is set as such:
      <h:column>
      <f:facet name="header">countryCode countryId</f:facet>
      #{company.countryCode.companyId} <!--is this the problem -->
      </h:column>
      


      Cheers,

      Damian.

        • 1. Re: Seam Gen template error?
          Gavin King Master

          Please report this in JIRA. And theres nothing pedantic about reporting bugs :-)

          • 2. Re: Seam Gen template error?
            Saeed Iqbal Novice

            Hey Guys while you are at the bug. Can you please report this if its not done already. when running seam generate-entities , i get the following error which refers to the file list.xhtml.ftl line 30 which is

            <#if property.value.typeName == "string">



            [hibernate] INFO: Hibernate Tools 3.2.0.snapshotb9
            Feb 17, 2007 11:27:43 AM org.hibernate.connection.DriverManagerConnectionProvider close
            INFO: cleaning up connection pool: jdbc:mysql:///test
            [hibernate] 2. task: generic exportertemplate: view/list.xhtml.ftl
            [hibernate] Feb 17, 2007 11:27:44 AM 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)


            Thanks. Any idea what could be the work-around to this? or maybe i should deploy the project before generating entities ?


            • 3. Re: Seam Gen template error?
              Clinton Parham Newbie

               

              "saeediqbal1" wrote:
              Hey Guys while you are at the bug. Can you please report this if its not done already. when running seam generate-entities , i get the following error which refers to the file list.xhtml.ftl line 30 which is
              <#if property.value.typeName == "string">



              [hibernate] INFO: Hibernate Tools 3.2.0.snapshotb9
              Feb 17, 2007 11:27:43 AM org.hibernate.connection.DriverManagerConnectionProvider close
              INFO: cleaning up connection pool: jdbc:mysql:///test
              [hibernate] 2. task: generic exportertemplate: view/list.xhtml.ftl
              [hibernate] Feb 17, 2007 11:27:44 AM 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.
              ...
              


              Thanks. Any idea what could be the work-around to this? or maybe i should deploy the project before generating entities ?


              You're not alone. I'm seeing the same error too when running against Oracle or MySQL

              Ideas anyone?


              • 4. Re: Seam Gen template error?
                Pete Muir Master

                Put it in JIRA :)

                • 5. Re: Seam Gen template error?
                  Damian Harvey Master

                  I had the same issue but reverting to the templates from CVS and re-applying my changes fixed it. I assumed that there was a difference in the versions there somehow.

                  • 6. Re: Seam Gen template error?
                    Saeed Iqbal Novice

                    i just used eclipses built in cvs rep. to download jboss-seam folder from the "head" section in the repository. is that the one with new template files? or was it the version section?

                    • 7. Re: Seam Gen template error?
                      Gavin King Master

                      This was already fixed in CVS.

                      • 8. Re: Seam Gen template error?
                        Saeed Iqbal Novice

                        i concur, this seems to be fixed now in the cvs build i downloaded.