5 Replies Latest reply on Nov 14, 2008 11:38 PM by Jan Groth

    seam generate is ignoring db-tables

    Jan Groth Novice

      Hello,


      I'm running seam generate / generate-model against a little (demo) db scheme. problem is that neither any error is thrown nor any classes are generated. i cant find anything suspicious in the logs, maybe someone else does?


      many thanks,


      Jan



      jan@rapanui:/datalinux/seam/code/theirs/jboss-seam-2.1.0.SP1$ ./seam generate-model
      SEAM_HOME: /datalinux/seam/code/theirs/jboss-seam-2.1.0.SP1
      Using seam-gen sources from: /datalinux/seam/code/theirs/jboss-seam-2.1.0.SP1/seam-gen
      Buildfile: /datalinux/seam/code/theirs/jboss-seam-2.1.0.SP1/seam-gen/build.xml
      
      init:
      
      init-properties:
           [echo] /datalinux/seam/code/theirs/jboss-AS-4.2.3.GA
      
      validate-workspace:
      
      validate-project:
      
      init-generate:
      
      generate-model:
           [echo] Reverse engineering database using JDBC driver /datalinux/seam/code/theirs/jboss-seam-2.1.0.SP1/lib/hsqldb.jar
           [echo] project=/datalinux/seam/code/mine/jmarticle
           [echo] model=com.adesso.jmarticle
      [hibernate] Executing Hibernate Tool with a JDBC Configuration (for reverse engineering)
      [hibernate] 1. task: hbm2java (Generates a set of .java files)
      [hibernate] Nov 13, 2008 9:53:59 PM org.hibernate.cfg.Environment <clinit>
      [hibernate] INFO: Hibernate 3.2.4.sp1
      [hibernate] Nov 13, 2008 9:53:59 PM org.hibernate.cfg.Environment <clinit>
      [hibernate] INFO: hibernate.properties not found
      [hibernate] Nov 13, 2008 9:53:59 PM org.hibernate.cfg.Environment buildBytecodeProvider
      [hibernate] INFO: Bytecode provider name : cglib
      [hibernate] Nov 13, 2008 9:53:59 PM org.hibernate.cfg.Environment <clinit>
      [hibernate] INFO: using JDK 1.4 java.sql.Timestamp handling
      [hibernate] Nov 13, 2008 9:53:59 PM org.hibernate.cfg.reveng.OverrideRepository addFile
      [hibernate] INFO: Override file: /datalinux/seam/code/mine/jmarticle/resources/seam-gen.reveng.xml
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure
      [hibernate] INFO: Using Hibernate built-in connection pool (not for production use!)
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure
      [hibernate] INFO: Hibernate connection pool size: 20
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure
      [hibernate] INFO: autocommit mode: false
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure
      [hibernate] INFO: using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:sql://localhost:9001/jmarticle
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure
      [hibernate] INFO: connection properties: {user=sa, password=****}
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: RDBMS: HSQL Database Engine, version: 1.8.0
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: JDBC driver: HSQL Database Engine Driver, version: 1.8.0
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.dialect.Dialect <init>
      [hibernate] INFO: Using dialect: org.hibernate.dialect.HSQLDialect
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
      [hibernate] INFO: Using default transaction strategy (direct JDBC transactions)
      [hibernate] Nov 13, 2008 9:54:00 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] Nov 13, 2008 9:54:00 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Automatic flush during beforeCompletion(): disabled
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Automatic session close at end of transaction: disabled
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: JDBC batch size: 15
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: JDBC batch updates for versioned data: disabled
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Scrollable result sets: enabled
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: JDBC3 getGeneratedKeys(): disabled
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Connection release mode: auto
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Default batch fetch size: 1
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Generate SQL with comments: disabled
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Order SQL updates by primary key: disabled
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Order SQL inserts for batching: disabled
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
      [hibernate] INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
      [hibernate] INFO: Using ASTQueryTranslatorFactory
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Query language substitutions: {}
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: JPA-QL strict compliance: disabled
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Second-level cache: enabled
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Query cache: disabled
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.cfg.SettingsFactory createCacheProvider
      [hibernate] INFO: Cache provider: org.hibernate.cache.HashtableCacheProvider
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Optimize cache for minimal puts: disabled
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Structured second-level cache entries: disabled
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Statistics: disabled
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Deleted entity synthetic identifier rollback: disabled
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Default entity-mode: pojo
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Named query checking : enabled
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.connection.DriverManagerConnectionProvider close
      [hibernate] INFO: cleaning up connection pool: jdbc:hsqldb:sql://localhost:9001/jmarticle
      [hibernate] Nov 13, 2008 9:54:00 PM org.hibernate.tool.Version <clinit>
      [hibernate] INFO: Hibernate Tools 3.2.2.GA
      [javaformatter] Java formatting of 0 files completed. Skipped 0 file(s).
      
      BUILD SUCCESSFUL
      Total time: 1 second
      


        • 1. Re: seam generate is ignoring db-tables
          Jan Groth Novice

          To double check the obvious:


          I first ran


          seam setup / create-project




          My db-connection-string is


          jdbc:hsqldb:hsql://localhost:9001/jmarticle




          that strings works fine in hsqldb-database-manager....

          • 2. Re: seam generate is ignoring db-tables
            Jan Groth Novice

            I'm using:


            seam 2.1.0 SP1, 
            ubuntu-linux 8.10 
            java 1.6.0.10
            JAVA_HOME is set, (but nothing more)




            It seems as if seam-gen is simply not finding any tables in the db.


            hsqldb is running in server-mode, started like this


            java -cp /datalinux/seam/code/theirs/hsqldb/lib/hsqldb.jar org.hsqldb.Server -database.0 file:jmarticle -dbname.0 jmarticle



            but as i said: I'm using 2 different tools to connect to the db using this connection string, and both tools display the tables and the content.



            jdbc:hsqldb:sql://localhost:9001/jmarticle





            • 3. Re: seam generate is ignoring db-tables
              Jan Groth Novice

              my generated seam-gen.properties:



              #Generated by seam setup
              #Thu Nov 13 21:37:18 CET 2008
              hibernate.connection.password=
              workspace.home=/datalinux/seam/code/mine
              model.package=com.adesso.jmarticle
              driver.jar=/datalinux/seam/code/theirs/jboss-seam-2.1.0.SP1/lib/hsqldb.jar
              action.package=com.adesso.jmarticle
              test.package=com.adesso.jmarticle.test
              database.type=hsql
              richfaces.skin=classic
              hibernate.default_catalog.null=
              hibernate.default_schema.null=
              database.drop=n
              project.name=jmarticle
              hibernate.connection.username=sa
              hibernate.connection.driver_class=org.hsqldb.jdbcDriver
              hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
              project.type=ear
              icefaces.home=
              database.exists=y
              jboss.home=/datalinux/seam/code/theirs/jboss-AS-4.2.3.GA
              hibernate.dialect=org.hibernate.dialect.HSQLDialect
              hibernate.connection.url=jdbc\:hsqldb\:sql\://localhost\:9001/jmarticle
              icefaces=n


              • 4. Re: seam generate is ignoring db-tables
                Jan Groth Novice

                No answer so far. :-(


                Can anyone confirm that seam generate is running with hsqdb in server mode?


                Any help appriciated...


                Thx,
                Jan

                • 5. Re: seam generate is ignoring db-tables
                  Jan Groth Novice

                  solved. at least a kind of.


                  i migrated everything to h2-db, and followed Dan Allen's open-18 example in terms of standard schema and standard catalog name. runs without issue now.


                  also, i got rid of those not-healty-looking lines in my build.properties.


                  hibernate.default_catalog.null=
                  hibernate.default_schema.null=
                  



                  that looks much better in my eyes...



                  hibernate.default_catalog=H2
                  hibernate.default_schema=PUBLIC
                  



                  so my vague guess is that I had a hsqldb schema / catalog issue.


                  hope that monologue of any help for someone.


                  Jan