1 2 3 Previous Next 30 Replies Latest reply on Dec 22, 2006 1:18 PM by Gert-Jan van de Streek

    Seam generate-entities failing

    Brandon Olivares Newbie

      Hi,

      I'm trying to use the seam-gen tool, but am getting some errors.

      When I go to generate entities from the database, i get the following:

      C:\jboss-seam>seam generate-entities
      Buildfile: C:\jboss-seam\seam-gen\build.xml
      
      validate-workspace:
      
      validate-project:
      
      generate-entities:
      [hibernate] Executing Hibernate Tool with a JDBC Configuration (for reverse engi
      neering)
      [hibernate] 1. task: hbm2java (Generates a set of .java files)
      [hibernate] Nov 29, 2006 8:18:27 PM org.hibernate.cfg.Environment <clinit>
      [hibernate] INFO: Hibernate 3.2 cr4
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.Environment <clinit>
      [hibernate] INFO: hibernate.properties not found
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.Environment buildBytecodeP
      rovider
      [hibernate] INFO: Bytecode provider name : cglib
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.Environment <clinit>
      [hibernate] INFO: using JDK 1.4 java.sql.Timestamp handling
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.connection.DriverManagerConnec
      tionProvider configure
      [hibernate] INFO: Using Hibernate built-in connection pool (not for production u
      se!)
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.connection.DriverManagerConnec
      tionProvider configure
      [hibernate] INFO: Hibernate connection pool size: 20
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.connection.DriverManagerConnec
      tionProvider configure
      [hibernate] INFO: autocommit mode: false
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.connection.DriverManagerConnec
      tionProvider configure
      [hibernate] INFO: using driver: org.postgresql.Driver at URL: jdbc:postgresql://
      localhost:5432/seam_test
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.connection.DriverManagerConnec
      tionProvider configure
      [hibernate] INFO: connection properties: {user=Brandon, password=****}
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.SettingsFactory buildSetti
      ngs
      [hibernate] INFO: RDBMS: PostgreSQL, version: 8.2beta3
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.SettingsFactory buildSetti
      ngs
      [hibernate] INFO: JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 8.2
      devel JDBC3 with SSL (build 503)
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.dialect.Dialect <init>
      [hibernate] INFO: Using dialect: org.hibernate.dialect.PostgreSQLDialect
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.transaction.TransactionFactory
      Factory buildTransactionFactory
      [hibernate] INFO: Using default transaction strategy (direct JDBC transactions)
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.transaction.TransactionManager
      LookupFactory getTransactionManagerLookup
      [hibernate] INFO: No TransactionManagerLookup configured (in JTA environment, us
      e of read-write or transactional second-level cache is not recommended)
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.SettingsFactory buildSetti
      ngs
      [hibernate] INFO: Automatic flush during beforeCompletion(): disabled
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.SettingsFactory buildSetti
      ngs
      [hibernate] INFO: Automatic session close at end of transaction: disabled
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.SettingsFactory buildSetti
      ngs
      [hibernate] INFO: JDBC batch size: 15
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.SettingsFactory buildSetti
      ngs
      [hibernate] INFO: JDBC batch updates for versioned data: disabled
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.SettingsFactory buildSetti
      ngs
      [hibernate] INFO: Scrollable result sets: enabled
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.SettingsFactory buildSetti
      ngs
      [hibernate] INFO: JDBC3 getGeneratedKeys(): disabled
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.SettingsFactory buildSetti
      ngs
      [hibernate] INFO: Connection release mode: auto
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.SettingsFactory buildSetti
      ngs
      [hibernate] INFO: Default batch fetch size: 1
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.SettingsFactory buildSetti
      ngs
      [hibernate] INFO: Generate SQL with comments: disabled
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.SettingsFactory buildSetti
      ngs
      [hibernate] INFO: Order SQL updates by primary key: disabled
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.SettingsFactory createQuer
      yTranslatorFactory
      [hibernate] INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFact
      ory
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.hql.ast.ASTQueryTranslatorFact
      ory <init>
      [hibernate] INFO: Using ASTQueryTranslatorFactory
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.SettingsFactory buildSetti
      ngs
      [hibernate] INFO: Query language substitutions: {}
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.SettingsFactory buildSetti
      ngs
      [hibernate] INFO: JPA-QL strict compliance: disabled
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.SettingsFactory buildSetti
      ngs
      [hibernate] INFO: Second-level cache: enabled
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.SettingsFactory buildSetti
      ngs
      [hibernate] INFO: Query cache: disabled
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.SettingsFactory createCach
      eProvider
      [hibernate] INFO: Cache provider: org.hibernate.cache.NoCacheProvider
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.SettingsFactory buildSetti
      ngs
      [hibernate] INFO: Optimize cache for minimal puts: disabled
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.SettingsFactory buildSetti
      ngs
      [hibernate] INFO: Structured second-level cache entries: disabled
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.SettingsFactory buildSetti
      ngs
      [hibernate] INFO: Statistics: disabled
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.SettingsFactory buildSetti
      ngs
      [hibernate] INFO: Deleted entity synthetic identifier rollback: disabled
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.SettingsFactory buildSetti
      ngs
      [hibernate] INFO: Default entity-mode: pojo
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.reveng.JDBCReader processP
      rimaryKey
      [hibernate] WARNING: The JDBC driver didn't report any primary key columns in pg
      _buffercache. Asking rev.eng. strategy
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.reveng.JDBCReader processP
      rimaryKey
      [hibernate] WARNING: Rev.eng. strategy did not report any primary key columns fo
      r pg_buffercache
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.reveng.JDBCReader processP
      rimaryKey
      [hibernate] WARNING: The JDBC driver didn't report any primary key columns in pg
      _freespacemap_pages. Asking rev.eng. strategy
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.reveng.JDBCReader processP
      rimaryKey
      [hibernate] WARNING: Rev.eng. strategy did not report any primary key columns fo
      r pg_freespacemap_pages
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.reveng.JDBCReader processP
      rimaryKey
      [hibernate] WARNING: The JDBC driver didn't report any primary key columns in pg
      _freespacemap_relations. Asking rev.eng. strategy
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.cfg.reveng.JDBCReader processP
      rimaryKey
      [hibernate] WARNING: Rev.eng. strategy did not report any primary key columns fo
      r pg_freespacemap_relations
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.connection.DriverManagerConnec
      tionProvider close
      [hibernate] INFO: cleaning up connection pool: jdbc:postgresql://localhost:5432/
      seam_test
      [hibernate] Nov 29, 2006 8:18:28 PM org.hibernate.tool.Version <clinit>
      [hibernate] INFO: Hibernate Tools 3.2.0.snapshotb9
      [hibernate] 2. task: generic exportertemplate: view/list.xhtml.ftl
      [hibernate] Nov 29, 2006 8:18:29 PM freemarker.log.JDK14LoggerFactory$JDK14Logge
      r error
      [hibernate] SEVERE:
      
      [hibernate] Expression pojo.identifierProperty is undefined on line 47, column 8
      5 in view/list.xhtml.ftl.
      [hibernate] The problematic instruction:
      [hibernate] ----------
      [hibernate] ==> ${pojo.identifierProperty.name} [on line 47, column 83 in view/l
      ist.xhtml.ftl]
      [hibernate] ----------
      
      [hibernate] Java backtrace for programmers:
      [hibernate] ----------
      [hibernate] freemarker.core.InvalidReferenceException: Expression pojo.identifie
      rProperty is undefined on line 47, column 85 in view/list.xhtml.ftl.
      [hibernate] at freemarker.core.TemplateObject.assertNonNull(TemplateObject.j
      ava:124)
      [hibernate] at freemarker.core.TemplateObject.invalidTypeException(TemplateO
      bject.java:134)
      [hibernate] at freemarker.core.Dot._getAsTemplateModel(Dot.java:78)
      [hibernate] at freemarker.core.Expression.getAsTemplateModel(Expression.java
      :89)
      [hibernate] at freemarker.core.Expression.getStringValue(Expression.java:93)
      
      [hibernate] at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
      
      [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(Templ
      ateHelper.java:245)
      [hibernate] at org.hibernate.tool.hbm2x.TemplateProducer.produceToString(Tem
      plateProducer.java:67)
      [hibernate] at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplatePro
      ducer.java:28)
      [hibernate] at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplatePro
      ducer.java:97)
      [hibernate] at org.hibernate.tool.hbm2x.GenericExporter.exportPOJO(GenericEx
      porter.java:84)
      [hibernate] at org.hibernate.tool.hbm2x.GenericExporter.exportComponent(Gene
      ricExporter.java:69)
      [hibernate] at org.hibernate.tool.hbm2x.GenericExporter.exportClasses(Generi
      cExporter.java:63)
      [hibernate] at org.hibernate.tool.hbm2x.GenericExporter.doStart(GenericExpor
      ter.java:41)
      [hibernate] at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExpor
      ter.java:95)
      [hibernate] at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java
      :40)
      [hibernate] at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToo
      lTask.java:182)
      [hibernate] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
      va: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.jav
      a:1216)
      [hibernate] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
      
      [hibernate] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(De
      faultExecutor.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 exportertemp
      late: view/list.xhtml.ftl
      [hibernate] To get the full stack trace run ant with -verbose
      [hibernate] org.hibernate.tool.hbm2x.ExporterException: Error while processing t
      emplate view/list.xhtml.ftl
      [hibernate] freemarker.core.InvalidReferenceException: Expression pojo.identifie
      rProperty is undefined on line 47, column 85 in view/list.xhtml.ftl.
      
      BUILD FAILED
      C:\jboss-seam\seam-gen\build.xml:639: org.hibernate.tool.hbm2x.ExporterException
      : Error while processing template view/list.xhtml.ftl
      
      Total time: 2 seconds
      
      C:\jboss-seam>


      JBoss version is 4.0.5, Seam is whatever is the latest download.

      Everything else has worked, like new-form, new-action, etc. I just am trying to get this to work.

      Database is postgresql. I specified the jdbc url first as jdbc:postgresql:seam_test, then as jdbc:postgresql://localhost:5432/seam_test

      Thanks,
      Brandon

        • 1. Re: Seam generate-entities failing
          Gavin King Master

          You can't reverse engineer tables that don't have primary keys. You should not have tables w/o primary keys anyway.

          • 2. Re: Seam generate-entities failing
            Brandon Olivares Newbie

            Hi,

            It does have a primary key. The create table statement was:

            CREATE TABLE users
            (
             username character varying(50) NOT NULL,
             email character varying(255) NOT NULL,
             CONSTRAINT username PRIMARY KEY (username)
            ) WITHOUT OIDS;
            ALTER TABLE users OWNER TO "Brandon";
            


            • 3. Re: Seam generate-entities failing
              Manuel Gentile Newbie

              Maybe there are some problems with Postgresql!!!
              I have the same error switching to Mysql solve the problem!!!

              • 4. Re: Seam generate-entities failing
                Brandon Olivares Newbie

                Hmm, interesting. I do prefer Postgresql, so I'd like to know if there's some way to resolve the problem.

                thanks for the replies.

                By the way what is the new-action command of the seam -gen tool supposed to be for? All it seems to do is respond to a button click. Isn't there a command for just adding a new page? That'd be very useful. :)

                • 5. Re: Seam generate-entities failing
                  Brandon Olivares Newbie

                  OK, I'm closer to having it work now. :)

                  I switched to mysql for now, just to test how this works.

                  I create a table named users, generate the entities, and it works. But then, I go to the test application, click "Users List", and get this:

                  Error - EntityManagerFactory not found in JNDI
                  An Error Occurred:
                  EntityManagerFactory not found in JNDI
                  - Stack Trace
                  java.lang.IllegalArgumentException: EntityManagerFactory not found in JNDI
                   at org.jboss.seam.core.ManagedPersistenceContext.getEntityManagerFactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:145)
                   at org.jboss.seam.core.ManagedPersistenceContext.createEntityManager(ManagedPersistenceContext.java:88)
                   at org.jboss.seam.core.ManagedPersistenceContext.create(ManagedPersistenceContext.java:69)
                   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                   at java.lang.reflect.Method.invoke(Method.java:597)
                   at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                   at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:102)
                   at org.jboss.seam.Component.callComponentMethod(Component.java:1767)
                   at org.jboss.seam.Component.callCreateMethod(Component.java:1707)
                   at org.jboss.seam.Component.newInstance(Component.java:1696)
                   at org.jboss.seam.Component.getInstance(Component.java:1600)
                   at org.jboss.seam.Component.getInstance(Component.java:1567)
                   at org.jboss.seam.Component.getInstance(Component.java:1561)
                   at org.jboss.seam.framework.EntityQuery.getEntityManager(EntityQuery.java:82)
                   at org.jboss.seam.framework.EntityQuery.validate(EntityQuery.java:25)
                   at org.jboss.seam.framework.EntityQuery$$FastClassByCGLIB$$225925e6.invoke(<generated>)
                   at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
                   at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:45)
                   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
                   at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:23)
                   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                   at java.lang.reflect.Method.invoke(Method.java:597)
                   at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                   at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                   at org.jboss.seam.interceptors.RollbackInterceptor.rollbackIfNecessary(RollbackInterceptor.java:33)
                   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                   at java.lang.reflect.Method.invoke(Method.java:597)
                   at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                   at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                   at org.jboss.seam.interceptors.BijectionInterceptor.bijectTargetComponent(BijectionInterceptor.java:51)
                   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                   at java.lang.reflect.Method.invoke(Method.java:597)
                   at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                   at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                   at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:51)
                   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                   at java.lang.reflect.Method.invoke(Method.java:597)
                   at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                   at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                   at org.jboss.seam.interceptors.TransactionInterceptor$1.work(TransactionInterceptor.java:25)
                   at org.jboss.seam.util.Work.workInTransaction(Work.java:31)
                   at org.jboss.seam.interceptors.TransactionInterceptor.doInTransactionIfNecessary(TransactionInterceptor.java:19)
                   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                   at java.lang.reflect.Method.invoke(Method.java:597)
                   at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                   at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                   at org.jboss.seam.interceptors.ExceptionInterceptor.handleExceptions(ExceptionInterceptor.java:28)
                   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                   at java.lang.reflect.Method.invoke(Method.java:597)
                   at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                   at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                   at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
                   at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
                   at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
                   at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:140)
                   at org.jboss.seam.intercept.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:75)
                   at com.azavia.SeamTest.UsersList$$EnhancerByCGLIB$$f7fbf004.validate(<generated>)
                   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                   at java.lang.reflect.Method.invoke(Method.java:597)
                   at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                   at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:102)
                   at org.jboss.seam.Component.callComponentMethod(Component.java:1759)
                   at org.jboss.seam.Component.callCreateMethod(Component.java:1707)
                   at org.jboss.seam.Component.newInstance(Component.java:1696)
                   at org.jboss.seam.Component.getInstance(Component.java:1600)
                   at org.jboss.seam.Component.getInstance(Component.java:1567)
                   at org.jboss.seam.jsf.SeamVariableResolver.resolveVariable(SeamVariableResolver.java:45)
                   at org.apache.myfaces.config.LastVariableResolverInChain.resolveVariable(LastVariableResolverInChain.java:42)
                   at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:134)
                   at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:65)
                   at com.sun.el.parser.AstValue.getValue(AstValue.java:106)
                   at com.sun.el.parser.AstEmpty.getValue(AstEmpty.java:49)
                   at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192)
                   at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
                   at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:56)
                   at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:1075)
                   at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:231)
                   at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
                   at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:580)
                   at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
                   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                   at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:32)
                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                   at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:46)
                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                   at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
                   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
                   at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
                   at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
                   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
                   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
                   at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
                   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
                   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
                   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
                   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
                   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
                   at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
                   at java.lang.Thread.run(Thread.java:619)
                  Caused by: javax.naming.NameNotFoundException: SeamTestEntityManagerFactory not bound
                   at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
                   at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
                   at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
                   at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
                   at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
                   at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
                   at javax.naming.InitialContext.lookup(InitialContext.java:392)
                   at org.jboss.seam.core.ManagedPersistenceContext.getEntityManagerFactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:141)
                   ... 127 more
                  + Component Tree
                  + Scoped Variables
                  Nov 30, 2006 6:34:35 AM - Generated by Facelets


                  I have no idea why I'd get such an error.

                  • 6. Re: Seam generate-entities failing
                    Gavin King Master

                    Do you have other messages before that in the log?

                    • 7. Re: Seam generate-entities failing
                      Brandon Olivares Newbie

                      I figured it out. It was reading an old datasource configuration I guess, and it was expecting a certain table that no longer existed.

                      It all works, now. :) Now just have to read the Seam reference and get more comfortable with all of this.

                      Thanks for the replies.

                      • 8. Re: Seam generate-entities failing
                        Manuel Gentile Newbie

                        BTW Gavin you known why seamgen doesn't work with PostgreSQL ?

                        Thanks!

                        • 9. Re: Seam generate-entities failing
                          Gavin King Master

                          No idea. You should report problems like this to Hibernate Tools guys (ie. Max Andersen).

                          • 10. Re: Seam generate-entities failing
                            Brandon Olivares Newbie

                            OK, some more problems.

                            I was trying a bit more complicated example.

                            I had some tabls like the following:

                            mysql> show create table user;show create table article;show create table commen
                            t;
                            +-------+-----------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            -------+
                            | Table | Create Table
                            
                             |
                            +-------+-----------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            -------+
                            | user | CREATE TABLE `user` (
                             `username` varchar(50) NOT NULL,
                             `email` varchar(255) NOT NULL,
                             PRIMARY KEY (`username`)
                            ) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
                            +-------+-----------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            -------+
                            1 row in set (0.22 sec)
                            
                            +---------+---------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            -------------------------------------------------------+
                            | Table | Create Table
                            
                            
                            
                             |
                            +---------+---------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            -------------------------------------------------------+
                            | article | CREATE TABLE `article` (
                             `id` int(10) unsigned NOT NULL auto_increment,
                             `username` varchar(50) NOT NULL,
                             `title` varchar(100) NOT NULL,
                             `text` text NOT NULL,
                             PRIMARY KEY (`id`),
                             KEY `username` (`username`),
                             CONSTRAINT `article_ibfk_1` FOREIGN KEY (`username`) REFERENCES `user` (`usern
                            ame`) ON UPDATE CASCADE
                            ) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
                            +---------+---------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            -------------------------------------------------------+
                            1 row in set (0.03 sec)
                            
                            +---------+---------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            --------------------+
                            | Table | Create Table
                            
                            
                            
                            
                            
                            
                             |
                            +---------+---------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            --------------------+
                            | comment | CREATE TABLE `comment` (
                             `id` int(10) unsigned NOT NULL,
                             `username` varchar(50) NOT NULL,
                             `article_id` int(10) unsigned NOT NULL,
                             `title` varchar(100) NOT NULL,
                             `comment` text NOT NULL,
                             PRIMARY KEY (`id`),
                             KEY `username` (`username`),
                             KEY `article_id` (`article_id`),
                             CONSTRAINT `comment_ibfk_1` FOREIGN KEY (`username`) REFERENCES `user` (`usern
                            ame`) ON DELETE CASCADE ON UPDATE CASCADE,
                             CONSTRAINT `comment_ibfk_2` FOREIGN KEY (`article_id`) REFERENCES `article` (`
                            id`) ON DELETE CASCADE ON UPDATE CASCADE
                            ) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
                            +---------+---------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            --------------------------------------------------------------------------------
                            --------------------+
                            1 row in set (0.01 sec)
                            
                            mysql>


                            so, i run seam generate-entities using this database, and a project I called blog.

                            It builds successfully, but I get some errors when I go to the project at http://localhost:8080/blog

                            The first noticeable thing is that when i go to create an article, or a user, etc, I get an error about requiring an ending s:button tag. When I looked at the template, for one of the tags, there was an s:button, but s:link was used to close it.

                            I don't know why is this happening. I'm guessing it is some bug. I figured this wasn't too complicated of an example to test on, but I don't know.

                            • 11. Re: Seam generate-entities failing
                              Gavin King Master

                              Use CR2 (released yesterday)

                              • 12. Re: Seam generate-entities failing
                                Brandon Olivares Newbie

                                Hi,

                                Unfortunately, that did not resolve the issue:

                                Error - Error Parsing /ArticleEdit.xhtml: Error Traced[line: 135] The element type "s:button" must be terminated by the matching end-tag "</s:button>".
                                An Error Occurred:
                                Error Parsing /ArticleEdit.xhtml: Error Traced[line: 135] The element type "s:button" must be terminated by the matching end-tag "</s:button>".
                                - Stack Trace
                                com.sun.facelets.FaceletException: Error Parsing /ArticleEdit.xhtml: Error Traced[line: 135] The element type "s:button" must be terminated by the matching
                                end-tag "</s:button>".
                                 at com.sun.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:234)
                                 at com.sun.facelets.compiler.Compiler.compile(Compiler.java:104)
                                 at com.sun.facelets.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:192)
                                 at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:141)
                                 at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:93)
                                 at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:503)
                                 at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:553)
                                 at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
                                 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
                                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                                 at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:32)
                                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                                 at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:46)
                                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                                 at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                                 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
                                 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
                                 at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
                                 at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
                                 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
                                 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
                                 at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
                                 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
                                 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
                                 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
                                 at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
                                 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
                                 at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
                                 at java.lang.Thread.run(Thread.java:619)
                                + Component Tree
                                + Scoped Variables
                                Dec 2, 2006 3:21:10 AM - Generated by Facelets


                                view/ArticleEdit.xhtml, lines 130-136:

                                <div class="actionButtons">
                                 <s:button id="addcomment" value="Add comment"
                                 view="/CommentEdit.xhtml" propagation="begin">
                                 <f:param name="articleId"
                                 value="#{articleHome.instance.id}"/>
                                 </s:link>
                                 </div>
                                


                                Obviously this is easily resolved, but it is obviously a bug.

                                Further, I get this error when trying to create a comment:

                                Error - /CommentEdit.xhtml: Bean: com.azavia.blog.User, property: id
                                An Error Occurred:
                                /CommentEdit.xhtml: Bean: com.azavia.blog.User, property: id
                                - Stack Trace
                                javax.el.ELException: /CommentEdit.xhtml: Bean: com.azavia.blog.User, property: id
                                 at com.sun.facelets.compiler.TextInstruction.write(TextInstruction.java:48)
                                 at com.sun.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:39)
                                 at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:433)
                                 at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChildren(RendererUtils.java:419)
                                 at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:440)
                                 at org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.renderColumnBody(HtmlTableRendererBase.java:332)
                                 at org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.encodeColumnChild(HtmlTableRendererBase.java:301)
                                 at org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.encodeInnerHtml(HtmlTableRendererBase.java:277)
                                 at org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.encodeChildren(HtmlTableRendererBase.java:123)
                                 at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:524)
                                 at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:234)
                                 at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
                                 at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:580)
                                 at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
                                 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
                                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                                 at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:32)
                                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                                 at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:46)
                                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                                 at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                                 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
                                 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
                                 at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
                                 at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
                                 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
                                 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
                                 at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
                                 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
                                 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
                                 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
                                 at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
                                 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
                                 at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
                                 at java.lang.Thread.run(Thread.java:619)
                                + Component Tree
                                + Scoped Variables
                                Dec 2, 2006 3:24:30 AM - Generated by Facelets


                                I don't know if this is it, but in CommentEdit.xhtml, there is:

                                <h:column>
                                 <f:facet name="header">user username</f:facet>
                                 #{article.user.id}
                                 </h:column>
                                


                                Is ID required for every table? It seems to be recognizing my primary key just fine everywhere else.

                                Thanks for the replies.

                                • 13. Re: Seam generate-entities failing
                                  Gavin King Master

                                  You are wrong. It is definitely fixed by CR2. Delete the generated code and regenerate using CR2.

                                  • 14. Re: Seam generate-entities failing
                                    Brandon Olivares Newbie

                                    Whoops, you're right.

                                    OK, just a few things then.

                                    I noticed that Seam assume syou're using the default configuration, and doesn't allow you to specify otherwise unless you do a mass search-replace.

                                    Everything else is looking great. Only thing is that it'd be nice if the generator would detect auto-incrementing columns, and not create a field for those, since one is usually not going to want to manually enter a value for that.

                                    Anyway, thanks for the help.

                                    1 2 3 Previous Next