4 Replies Latest reply on Oct 15, 2008 10:11 AM by maxandersen

    seam-gen throwing exception

    sanghakanwar

      Hi,

      Seam generate entities using JBoss tools (JBossTools-2.1.2.GA-ALL-win32) is throwing the following exception -

      Can't generate seam entities org.hibernate.tool.hbm2x.ExporterException: Error while processing Entity: org.domain.SeamGen.entity.Auditlog with template view/list.xhtml.ftl Error while processing Entity: org.domain.SeamGen.entity.Auditlog with template view/list.xhtml.ftl org.hibernate.tool.hbm2x.ExporterException: Error while processing Entity: org.domain.SeamGen.entity.Auditlog with template view/list.xhtml.ftl Error while processing Entity: org.domain.SeamGen.entity.Auditlog with template view/list.xhtml.ftl freemarker.core.InvalidReferenceException: Expression util.isToOne is undefined on line 27, column 38 in view/list.xhtml.ftl. Expression util.isToOne is undefined on line 27, column 38 in view/list.xhtml.ftl


      seam version - 2.1.0.CR1
      Jboss Tools - 2.1.2.GA

        • 1. Re: seam-gen throwing exception
          maxandersen

          Does it fail when running from command line too ?

          • 2. Re: seam-gen throwing exception
            sanghakanwar

            No. If i run "seam generate-entites" from cmd line, it works fine.

            • 3. Re: seam-gen throwing exception
              tcmartin24

              I've figured out a work-around that works ok for me. I did a global search/replace in the jboss-seam directory (in my case, jboss-seam-2.1.0.CR1) on the seam-gen/src & seam-gen/view directories looking for occurrences of "util.isToOne" and replaced them with "c2h.isManyToOne" on *.ftl files. This seems to have done the trick. I imagine this should be a temporary fix 'till the developers address the fact that apparently the Freemarker context maybe doesn't know about the 'util' variable or it's not mapped to a class that actually contains a method called "isToOne" or something along those lines.

              • 4. Re: seam-gen throwing exception
                maxandersen

                yes - this is a known issue with the current way we use the template from seam-gen; we don't use the provided jar directly. We'll need to get that fixed.

                Your soluction is though correct for this specific method.