5 Replies Latest reply on Oct 7, 2008 12:03 AM by Anthony Heukmes

    seam generate with Oracle db

    Anthony Heukmes Newbie

      Hi,


      I discovered Seam a few hours ago and I'm trying to generate a CRUD application with the generate method.


      So after setup / create-project, I tried to generate but got the following result :



      antho:jboss-seam antho$ ./seam generate
      Buildfile: build.xml
      
      init:
      
      init-properties:
           [echo] /Applications/jboss
      
      validate-workspace:
      
      validate-project:
      
      init-generate:
      
      generate-model:
           [echo] Reverse engineering database using JDBC driver ../lib/ojdbc14.jar
           [echo] project=/Users/antho/Workspace/seam/demo
           [echo] model=demo.model
      [hibernate] Executing Hibernate Tool with a JDBC Configuration (for reverse engineering)
      [hibernate] 1. task: hbm2java (Generates a set of .java files)
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.Environment <clinit>
      [hibernate] INFO: Hibernate 3.2.4.sp1
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.Environment <clinit>
      [hibernate] INFO: hibernate.properties not found
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.Environment buildBytecodeProvider
      [hibernate] INFO: Bytecode provider name : cglib
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.Environment <clinit>
      [hibernate] INFO: using JDK 1.4 java.sql.Timestamp handling
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.reveng.OverrideRepository addFile
      [hibernate] INFO: Override file: /Users/antho/Workspace/seam/demo/resources/seam-gen.reveng.xml
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.connection.DriverManagerConnectionProvider configure
      [hibernate] INFO: Using Hibernate built-in connection pool (not for production use!)
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.connection.DriverManagerConnectionProvider configure
      [hibernate] INFO: Hibernate connection pool size: 20
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.connection.DriverManagerConnectionProvider configure
      [hibernate] INFO: autocommit mode: false
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.connection.DriverManagerConnectionProvider configure
      [hibernate] INFO: using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@192.168.85.128:1521:orcl
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.connection.DriverManagerConnectionProvider configure
      [hibernate] INFO: connection properties: {user=irs_com, password=****}
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: RDBMS: Oracle, version: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
      [hibernate] With the Partitioning, OLAP and Data Mining options
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: JDBC driver: Oracle JDBC driver, version: 10.1.0.5.0
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.dialect.Dialect <init>
      [hibernate] INFO: Using dialect: org.hibernate.dialect.OracleDialect
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
      [hibernate] INFO: Using default transaction strategy (direct JDBC transactions)
      [hibernate] Oct 5, 2008 8:46:15 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] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Automatic flush during beforeCompletion(): disabled
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Automatic session close at end of transaction: disabled
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: JDBC batch size: 15
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: JDBC batch updates for versioned data: disabled
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Scrollable result sets: enabled
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: JDBC3 getGeneratedKeys(): disabled
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Connection release mode: auto
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Default schema: irs_com
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Default catalog: irs_com
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Default batch fetch size: 1
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Generate SQL with comments: disabled
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Order SQL updates by primary key: disabled
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Order SQL inserts for batching: disabled
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
      [hibernate] INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
      [hibernate] INFO: Using ASTQueryTranslatorFactory
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Query language substitutions: {}
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: JPA-QL strict compliance: disabled
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Second-level cache: enabled
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Query cache: disabled
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory createCacheProvider
      [hibernate] INFO: Cache provider: org.hibernate.cache.HashtableCacheProvider
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Optimize cache for minimal puts: disabled
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Structured second-level cache entries: disabled
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Statistics: disabled
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Deleted entity synthetic identifier rollback: disabled
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Default entity-mode: pojo
      [hibernate] Oct 5, 2008 8:46:15 PM org.hibernate.cfg.SettingsFactory buildSettings
      [hibernate] INFO: Named query checking : enabled
      [hibernate] Oct 5, 2008 8:46:16 PM org.hibernate.connection.DriverManagerConnectionProvider close
      [hibernate] INFO: cleaning up connection pool: jdbc:oracle:thin:@192.168.85.128:1521:orcl
      [hibernate] Oct 5, 2008 8:46:16 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).
      
      generate-ui:
           [echo] Building project 'demo' to generate views and controllers
      
      init:
      
      groovy.compilemodel:
      
      compilemodel:
      
      groovy.compileactions:
      
      groovy.copyactions:
      
      compileactions:
      
      copyclasses:
      
      war:
           [copy] Copying 1 file to /Users/antho/Workspace/seam/demo/exploded-archives/demo.war
           [copy] Copying 1 file to /Users/antho/Workspace/seam/demo/exploded-archives/demo.war/WEB-INF/classes/META-INF
           [copy] Copying 1 file to /Users/antho/Workspace/seam/demo/exploded-archives/demo.war/WEB-INF/classes
      [hibernate] Executing Hibernate Tool with a JPA Configuration
      [hibernate] 1. task: generic exportertemplate: view/list.xhtml.ftl
      [hibernate] Oct 5, 2008 8:46:16 PM org.hibernate.cfg.annotations.Version <clinit>
      [hibernate] INFO: Hibernate Annotations 3.3.0.GA
      [hibernate] Oct 5, 2008 8:46:16 PM org.hibernate.ejb.Version <clinit>
      [hibernate] INFO: Hibernate EntityManager 3.3.1.GA
      [hibernate] 2. task: generic exportertemplate: view/view.xhtml.ftl
      [hibernate] 3. task: generic exportertemplate: view/view.page.xml.ftl
      [hibernate] 4. task: generic exportertemplate: view/edit.xhtml.ftl
      [hibernate] 5. task: generic exportertemplate: view/edit.page.xml.ftl
      [hibernate] 6. task: generic exportertemplate: src/EntityList.java.ftl
      [hibernate] 7. task: generic exportertemplate: view/list.page.xml.ftl
      [hibernate] 8. task: generic exportertemplate: src/EntityHome.java.ftl
      [hibernate] 9. task: generic exportertemplate: view/layout/menu.xhtml.ftl
      [javaformatter] Java formatting of 1 files completed. Skipped 0 file(s).
           [echo] Type 'seam restart' and go to http://localhost:8080/demo
      
      generate:
      
      BUILD SUCCESSFUL
      Total time: 2 seconds



      It doesn't generate anything...
      My schema exists and has 10 tables in it.


      My build.properties file :



      #Generated by seam setup
      #Sun Oct 05 20:37:46 CEST 2008
      hibernate.connection.password=******
      workspace.home=/Users/antho/Workspace/seam
      model.package=demo.model
      hibernate.default_catalog=irs_com
      driver.jar=../lib/ojdbc14.jar
      action.package=demo.action
      test.package=demo.test
      database.type=oracle
      richfaces.skin=blueSky
      hibernate.default_schema=irs_com
      database.drop=n
      project.name=demo
      hibernate.connection.username=irs_com
      hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver
      hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
      project.type=war
      icefaces.home=
      database.exists=y
      jboss.home=/Applications/jboss
      hibernate.dialect=org.hibernate.dialect.OracleDialect
      hibernate.connection.url=jdbc\:oracle\:thin\:@192.168.85.128\:1521\:orcl
      icefaces=n





      Do you have any idea?


      Thanks in advance!

        • 1. Re: seam generate with Oracle db
          Val Sw Expert

          Hi Anthony,


          Which version of Oracle you are using... is it 10g ?

          • 2. Re: seam generate with Oracle db
            Val Sw Expert
            I think it is 10g...

            Though not sure if it will fix, can you try using
            hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
            • 3. Re: seam generate with Oracle db
              Anthony Heukmes Newbie

              Yes, I'm using 10g.




              BUILD FAILED
              /Applications/jboss-seam/seam-gen/build.xml:1112: org.hibernate.HibernateException: Dialect class not found: org.hibernate.dialect.Oracle10gDialect



              Is it correct to use the name of my schema for the catalog name?



              hibernate.default_catalog=irs_com



              I tried with another schema on MySQL and I worked like a charm.
              But no way to have it working on Oracle. :-(

              • 4. Re: seam generate with Oracle db
                Anthony Heukmes Newbie

                I tried to gen entities from Eclipse but I got the following error :



                Can't generate seam entities
                  org.hibernate.cfg.JDBCBinderException: Duplicate class name 'ora.entity.AllFileGroups' generated for 'org.hibernate.mapping.Table(SYS._ALL_FILE_GROUPS)'. Same name where generated for 'org.hibernate.mapping.Table(SYS._ALL_FILE_GROUPS)'
                  Duplicate class name 'ora.entity.AllFileGroups' generated for 'org.hibernate.mapping.Table(SYS._ALL_FILE_GROUPS)'. Same name where generated for 'org.hibernate.mapping.Table(SYS._ALL_FILE_GROUPS)'
                    org.hibernate.cfg.JDBCBinderException: Duplicate class name 'ora.entity.AllFileGroups' generated for 'org.hibernate.mapping.Table(SYS._ALL_FILE_GROUPS)'. Same name where generated for 'org.hibernate.mapping.Table(SYS._ALL_FILE_GROUPS)'
                    Duplicate class name 'ora.entity.AllFileGroups' generated for 'org.hibernate.mapping.Table(SYS._ALL_FILE_GROUPS)'. Same name where generated for 'org.hibernate.mapping.Table(SYS._ALL_FILE_GROUPS)'



                Can you help me?


                Thanks!

                • 5. Re: seam generate with Oracle db
                  Anthony Heukmes Newbie

                  Ok it's working now.
                  You have to set the schema name in uppercase.