10 Replies Latest reply on Aug 25, 2009 12:19 PM by hosamaly

    Seam-gen generate does not work properly

    rgoytacaz
      Hello Seam Users,

      I'm having a couple problems with my Seam start up.

      I did the ./seam generate to reverse my current postgres db, which contains 4 tables, first I though everything was okay, just a warning message, but when I imported the project into eclipse, I saw that none of my packages had any class.

      This is the error that seam generate, got me.

      [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).

      Any ideas?

      Regards
        • 1. Re: Seam-gen generate does not work properly

          are you using seam-gen with Eclipse? In that case check you have specified to include all tables from your schema with Seam Generate entities option wizard. Otherwise, no class is generated as no table is to be processed.
          If you are using console seam-gen command please paste your project build.properties settings file to have a look.

          • 2. Re: Seam-gen generate does not work properly
            hosamaly

            I was having the same exact problem today. I was able to resolve it by editing the file



            jboss-seam-2.2.0.GA/seam-gen/build.properties

            and setting the value of the property:


            hibernate.default_schema=



            (i.e. remove anything after the equal sign).

            • 3. Re: Seam-gen generate does not work properly
              rgoytacaz
              Hey there,

              Thx for your reply..

              Im using the latest version of seam 2.2.0GA

              the build.properties inside seam-2.2.0GA looks like this.

              Im using postgres 8.4.

              #Generated by seam setup
              #Sun Aug 23 22:59:57 BRT 2009
              hibernate.connection.password=ommited for security purposes
              workspace.home=/home/rgoytacaz/workspace
              hibernate.connection.dataSource_class=org.postgresql.jdbc3.Jdbc3ConnectionPool
              model.package=com.atom.Commerce.model
              hibernate.default_catalog=PostgreSQL
              driver.jar=/home/rgoytacaz/postgresql-8.4-701.jdbc4.jar
              action.package=com.atom.Commerce.action
              test.package=com.atom.Commerce.test
              database.type=postgres
              richfaces.skin=ruby
              glassfish.domain=domain1
              hibernate.default_schema=Core
              database.drop=n
              project.name=Atom
              hibernate.connection.username=postgres
              glassfish.home=C\:/Program Files/glassfish-v2.1
              hibernate.connection.driver_class=org.postgresql.Driver
              hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
              jboss.domain=default
              project.type=war
              icefaces.home=
              database.exists=y
              jboss.home=/srv/jboss-5.1.0.GA
              driver.license.jar=
              hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
              hibernate.connection.url=jdbc\:postgresql\:Atom
              icefaces=n

              • 4. Re: Seam-gen generate does not work properly

                I´m using version 2.1.2 but everything seems to be ok, check Core is the name of your database schema and is written with the correct case and that url connection is the proper one.

                • 5. Re: Seam-gen generate does not work properly
                  rgoytacaz

                  Looking at my build.properties...


                  I realize that Im using a jdbc4 driver and hibernate is using a jdbc3 driver.. this must be the case...


                  Whats the hibernate jdbc4 drivers name?

                  • 6. Re: Seam-gen generate does not work properly
                    rgoytacaz

                    Yea, its the correct schema name.. :(


                    • 7. Re: Seam-gen generate does not work properly
                      rgoytacaz

                      I thought the problem to be about the log4j.. appender error..


                      • 8. Re: Seam-gen generate does not work properly
                        rgoytacaz

                        Any help??

                        • 9. Re: Seam-gen generate does not work properly

                          um, really strange. Try it with seam 2.1.x to make it sure it is not an issue related to seam 2.2.0.

                          • 10. Re: Seam-gen generate does not work properly
                            hosamaly

                            There is a problem with your data source definition. I know you're using the default provided by seam setup, but that's incorrect, because this class does not exist in postgresql-8.4-701.jdbc4.jar. Try changing your configuration to:


                            hibernate.connection.dataSource_class=org.postgresql.ds.PGConnectionPoolDataSource