0 Replies Latest reply on Jan 18, 2011 4:24 PM by m0

    seam-gen generate does reverse engineer the db tables

    m0

      Hi all,


      I am trying to generate the entities and CRUD via seam, but I am have been trying so hard and nothing is being obvious to me. Hopefully someone can point something wrong.


      1. I created my own H2 database as well (and verified I can connect to it)
      2. Successfully ran seam setup
      3. Successfully create-project (verified the directories created).
      3. Next, running seam-gen completed, but nothing generated.


      My seam-gen properties file is the following:




      #Generated by seam setup
      #Tue Jan 18 14:53:47 EST 2011
      hibernate.connection.password=
      workspace.home=C\:/project/code/seam/projects
      hibernate.connection.dataSource_class=org.h2.jdbcx.JdbcDataSource
      model.package=com.foo.model
      hibernate.default_catalog=H2
      driver.jar=c\:/project/code/seam/driver/h2.jar
      action.package=com.foo.action
      test.package=com.foo.test
      database.type=h2
      richfaces.skin=
      glassfish.domain=domain1
      hibernate.default_schema=PUBLIC
      database.drop=n
      project.name=foo
      hibernate.connection.username=sa
      glassfish.home=C\:/Program Files/glassfish-v2.1
      hibernate.connection.driver_class=org.h2.Driver
      hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
      jboss.domain=default
      project.type=war
      icefaces.home=
      database.exists=y
      jboss.home=c\:/project/code/seam/jboss-5.1.0.GA
      driver.license.jar=
      hibernate.dialect=org.hibernate.dialect.H2Dialect
      hibernate.connection.url=jdbc\:h2\:C\:/project/code/seam/test
      icefaces=y



      And the output of seam generate is the following:




      C:\project\code\seam\jboss-seam-2.2.0.GA>seam generate
      SEAM_HOME: C:\project\code\seam\jboss-seam-2.2.0.GA
      Using seam-gen sources from: C:\project\code\seam\jboss-seam-2.2.0.GA\seam-gen
      Buildfile: C:\project\code\seam\jboss-seam-2.2.0.GA\seam-gen\build.xml
      
      init:
      
      init-properties:
           [echo] c:/project/code/seam/jboss-5.1.0.GA
      
      validate-workspace:
      
      validate-project:
      
      init-generate:
      
      generate-model:
           [echo] Reverse engineering database using JDBC driver c:/project/code/seam/driver/h2.jar
           [echo] project=C:/project/code/seam/projects/foo
           [echo] model=com.foo.model
      [hibernate] Executing Hibernate Tool with a JDBC Configuration (for reverse engineering)
      [hibernate] 1. task: hbm2java (Generates a set of .java files)
      [hibernate] log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
      [hibernate] log4j:WARN Please initialize the log4j system properly.
      [javaformatter] Java formatting of 0 files completed. Skipped 0 file(s).
      
      generate-ui:
           [echo] Building project 'foo' to generate views and controllers
      
      init:
      
      groovy.compilemodel:
      
      compilemodel:
      
      groovy.compileactions:
      
      groovy.copyactions:
      
      compileactions:
          [javac] Compiling 2 source files to C:\project\code\seam\projects\foo\exploded-archives\sshkeymana
      gement.war\WEB-INF\dev
      
      copyclasses:
      
      compile:
      
      war:
      [hibernate] Executing Hibernate Tool with a JPA Configuration
      [hibernate] 1. task: generic exportertemplate: view/list.xhtml.ftl
      [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 2 files completed. Skipped 0 file(s).
           [echo] Type 'seam restart' and go to http://localhost:8080/foo
      
      generate:
      
      BUILD SUCCESSFUL
      Total time: 3 seconds
      
      C:\project\code\seam\jboss-seam-2.2.0.GA>




      I am verifying if any new files have been added, but nothing is. Other commands such as new-action , new-form, new-entity all work just fine.


      Any idea what might be wrong? I have been searching the Documentation and trying to figure out how to debug seam-gen but didn't find anything interesting.


      So is my last resort just checking out the source code of seam and debug it? I am really curious on the whole CRUD seam-gen produces,  from reading Dan Allens book.


      Any help is appreciated!