4 Replies Latest reply on Mar 23, 2007 6:34 PM by Andy Dennis

    seam-gen error

    Lloyd Closson Newbie

      Running seam-gen generate-entities command (just built from CVS) I am experiencing the error below. After searching the form and Jira a similiar error has appeared and it was suggested by Gavin that old jars are somewhere. I have verified this is not the case. If I can provide any additional information to assist please let me know. Any help would be greatly appreciated.

      C:\eclipse\workspace\jboss-seam>seam generate-entities
      Buildfile: C:\eclipse\workspace\jboss-seam\seam-gen\build.xml
      
      validate-workspace:
      
      validate-project:
      
      generate-entities:
      [hibernate] Executing Hibernate Tool with a JDBC Configuration (for reverse engineering)
      [hibernate] 1. task: hbm2java (Generates a set of .java files)
      [hibernate] Mar 22, 2007 9:36:59 PM org.hibernate.cfg.Environment <clinit>
      [hibernate] INFO: Hibernate 3.2.0.cr5
      [hibernate] Mar 22, 2007 9:36:59 PM org.hibernate.cfg.Environment <clinit>
      [hibernate] INFO: hibernate.properties not found
      [hibernate] Mar 22, 2007 9:36:59 PM org.hibernate.cfg.Environment buildBytecodeProvider
      [hibernate] INFO: Bytecode provider name : cglib
      [hibernate] Mar 22, 2007 9:36:59 PM org.hibernate.cfg.Environment <clinit>
      [hibernate] INFO: using JDK 1.4 java.sql.Timestamp handling
      [hibernate] Mar 22, 2007 9:37:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure
      [hibernate] INFO: Using Hibernate built-in connection pool (not for production use!)
      [hibernate] Mar 22, 2007 9:37:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure
      [hibernate] INFO: Hibernate connection pool size: 20
      [hibernate] Mar 22, 2007 9:37:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure
      [hibernate] INFO: autocommit mode: false
      [hibernate] Mar 22, 2007 9:37:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure
      [hibernate] INFO: using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql:///adtutor
      [hibernate] Mar 22, 2007 9:37:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure
      [hibernate] INFO: connection properties: {user=adtutorapp, password=****}
      [hibernate] Mar 22, 2007 9:37:01 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: RDBMS: MySQL, version: 5.0.27-community-nt
      [hibernate] Mar 22, 2007 9:37:01 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-3.1.10 ( $Date: 2005/05/19 15:52:23 $, $Revision: 1.1.2.2 $ )
      [hibernate] Mar 22, 2007 9:37:02 PM org.hibernate.dialect.Dialect <init>
      [hibernate] INFO: Using dialect: org.hibernate.dialect.MySQLDialect
      [hibernate] Mar 22, 2007 9:37:02 PM org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
      [hibernate] INFO: Using default transaction strategy (direct JDBC transactions)
      [hibernate] Mar 22, 2007 9:37:02 PM org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
      [hibernate] INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
      [hibernate] Mar 22, 2007 9:37:02 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Automatic flush during beforeCompletion(): disabled
      [hibernate] Mar 22, 2007 9:37:02 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Automatic session close at end of transaction: disabled
      [hibernate] Mar 22, 2007 9:37:02 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: JDBC batch size: 15
      [hibernate] Mar 22, 2007 9:37:02 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: JDBC batch updates for versioned data: disabled
      [hibernate] Mar 22, 2007 9:37:02 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Scrollable result sets: enabled
      [hibernate] Mar 22, 2007 9:37:02 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: JDBC3 getGeneratedKeys(): enabled
      [hibernate] Mar 22, 2007 9:37:02 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Connection release mode: auto
      [hibernate] Mar 22, 2007 9:37:02 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Maximum outer join fetch depth: 2
      [hibernate] Mar 22, 2007 9:37:02 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Default batch fetch size: 1
      [hibernate] Mar 22, 2007 9:37:02 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Generate SQL with comments: disabled
      [hibernate] Mar 22, 2007 9:37:02 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Order SQL updates by primary key: disabled
      [hibernate] Mar 22, 2007 9:37:02 PM org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
      [hibernate] INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
      [hibernate] Mar 22, 2007 9:37:02 PM org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
      [hibernate] INFO: Using ASTQueryTranslatorFactory
      [hibernate] Mar 22, 2007 9:37:02 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Query language substitutions: {}
      [hibernate] Mar 22, 2007 9:37:02 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: JPA-QL strict compliance: disabled
      [hibernate] Mar 22, 2007 9:37:02 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Second-level cache: enabled
      [hibernate] Mar 22, 2007 9:37:02 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Query cache: disabled
      [hibernate] Mar 22, 2007 9:37:02 PM org.hibernate.cfg.SettingsFactory createCacheProvider
      [hibernate] INFO: Cache provider: org.hibernate.cache.NoCacheProvider
      [hibernate] Mar 22, 2007 9:37:02 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Optimize cache for minimal puts: disabled
      [hibernate] Mar 22, 2007 9:37:02 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Structured second-level cache entries: disabled
      [hibernate] Mar 22, 2007 9:37:02 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Statistics: disabled
      [hibernate] Mar 22, 2007 9:37:02 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Deleted entity synthetic identifier rollback: disabled
      [hibernate] Mar 22, 2007 9:37:02 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Default entity-mode: pojo
      [hibernate] Mar 22, 2007 9:37:07 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey
      [hibernate] WARNING: The JDBC driver didn't report any primary key columns in onet_soc_code_dwa_map. Asking rev.eng. strategy
      [hibernate] Mar 22, 2007 9:37:07 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey
      [hibernate] WARNING: Rev.eng. strategy did not report any primary key columns for onet_soc_code_dwa_map
      [hibernate] Mar 22, 2007 9:37:07 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey
      [hibernate] WARNING: The JDBC driver didn't report any primary key columns in user_role. Asking rev.eng. strategy
      [hibernate] Mar 22, 2007 9:37:07 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey
      [hibernate] WARNING: Rev.eng. strategy did not report any primary key columns for user_role
      [hibernate] Mar 22, 2007 9:37:08 PM org.hibernate.connection.DriverManagerConnectionProvider close
      [hibernate] INFO: cleaning up connection pool: jdbc:mysql:///adtutor
      [hibernate] Mar 22, 2007 9:37:08 PM org.hibernate.tool.Version <clinit>
      [hibernate] INFO: Hibernate Tools 3.2.0.b9
      Mar 22, 2007 9:37:09 PM org.hibernate.connection.DriverManagerConnectionProvider close
      INFO: cleaning up connection pool: jdbc:mysql:///adtutor
      [hibernate] 2. task: generic exportertemplate: view/list.xhtml.ftl
      [hibernate] Mar 22, 2007 9:37:10 PM freemarker.log.JDK14LoggerFactory$JDK14Logger error
      [hibernate] SEVERE:
      
      [hibernate] No signature of method getPOJOClass matches (java.lang.Object)
      [hibernate] The problematic instruction:
      [hibernate] ----------
      [hibernate] ==> assignment: parentPojo=c2j.getPOJOClass(cfg.getClassMapping(property.value.referencedEntityName)) [on line 91, column 1 in view/list.xhtml.ftl]
      [hibernate] ----------
      
      [hibernate] Java backtrace for programmers:
      [hibernate] ----------
      [hibernate] freemarker.template.TemplateModelException: No signature of method getPOJOClass matches (java.lang.Object)
      [hibernate] at freemarker.ext.beans.MethodMap.getMostSpecific(MethodMap.java:191)
      [hibernate] at freemarker.ext.beans.OverloadedMethodModel.exec(OverloadedMethodModel.java:105)
      [hibernate] at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93)
      [hibernate] at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
      [hibernate] at freemarker.core.Assignment.accept(Assignment.java:90)
      [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.ConditionalBlock.accept(ConditionalBlock.java:79)
      [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.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:146)
      [hibernate] at org.hibernate.tool.hbm2x.GenericExporter.exportPersistentClass(GenericExporter.java:135)
      [hibernate] at org.hibernate.tool.hbm2x.GenericExporter$2.process(GenericExporter.java:41)
      [hibernate] at org.hibernate.tool.hbm2x.GenericExporter.doStart(GenericExporter.java:126)
      [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:183)
      [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.template.TemplateModelException: No signature of method getPOJOClass matches (java.lang.Object)
      
      BUILD FAILED
      C:\eclipse\workspace\jboss-seam\seam-gen\build.xml:808: org.hibernate.tool.hbm2x.ExporterException: Error while processing template view/list.xhtml.ftl
      
      Total time: 12 seconds
      
      C:\eclipse\workspace\jboss-seam>
      


        • 1. Re: seam-gen error
          Lloyd Closson Newbie

          As a follow-up, I am able to run seam generate-entities against other databases, even databases with hundreds of tables, successfully. I am confident that everything is configured correctly and no stray jars are creating the problem.

          The only difference I can find between the schema causing the error and the schemas that work correctly, is the schema with the error has multiple many to many relationships - although the Entity beans are created correctly with proper mappings before this error occurs.

          If anyone has experienced this error - or who has any ideas as to how to solve this problem I would greatly appreciate it. It will save me a ton of typing.

          Thanks in advance.

          • 2. Re: seam-gen error
            Lloyd Closson Newbie

            It was the many to many relationship. I can duplicate this problem in all of my schemas.

            Simply create three tables. Table A, Table B, Table C. Table A and Table C have a many to many relationship. Table B is the link between them that just contains Table A and Table C primary keys with foreign key constraints to the appropriate tables.

            Then run seam generate-entities - I can't think of a scenario where this is something specific to my environment, but maybe I am missing something.

            • 3. Re: seam-gen error
              Gavin King Master

              seam-gen does not support many-to-manys, I'm not sure exactly what conditions cause Hibernate Tools to create them, but it can probably be turned off.

              • 4. Re: seam-gen error
                Andy Dennis Newbie

                I've just come across something similar. I'm using fabForce DBDesigner4 to generate a model and then export to a database. If I use a many to many relationship DBD4 models it with a table representing the relationship with only two foreign keys and generate-entities then uses @ManyToMany. I added a single column to the table design representing the relationship and generate-entities no longer uses a @ManyToMany. Hope this helps.
                Andy.