6 Replies Latest reply on Mar 5, 2008 9:36 PM by alex_ro_bv

    seam generate-entities on 2.1.0A1 problem

    alex_ro_bv

      Hello, I've downloaded and tested the new 2.1.0A1 seam version, but I have a problem....:(
      It seems that when I try to generate my entities, the database cannot be found. Unfortunately the name of the database is not the one I've given in the setup, but the username. My build.properties inside the seam-gen looks fine, but can't generate the entities. I'm using postgres with postgresql-8.2-506.jdbc4.jar and the all the settings for the connection are looking good...


      Can anyone help me why is this happening on this version?
      Thank you.

        • 1. Re: seam generate-entities on 2.1.0A1 problem
          jbalunas.jbalunas.jboss.org

          Hello,


          Could you post your build.properties, and the output from seam-gen where it is accessing a different DB?


          Thanks,
          Jay

          • 2. Re: seam generate-entities on 2.1.0A1 problem
            alex_ro_bv
            hibernate.connection.password=manager
            workspace.home=D\:/scoala/JAVA/workspace/
            model.package=beans.entity
            hibernate.default_catalog=hotel
            driver.jar=lib/postgresql-8.2-506.jdbc4.jar
            action.package=beans.session
            test.package=beans.test
            database.type=postgres
            richfaces.skin=ruby
            hibernate.default_schema.null=
            database.drop=n
            project.name=hblv
            hibernate.connection.username=manager
            hibernate.connection.driver_class=org.postgresql.Driver
            hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
            project.type=war
            icefaces.home=
            database.exists=y
            jboss.home=D\:/scoala/JAVA/install/jboss-4.2.2.GA/
            hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
            hibernate.connection.url=jdbc\:postgresql\://localhost\:5432
            icefaces=n
            


            • 3. Re: seam generate-entities on 2.1.0A1 problem
              alex_ro_bv
              hibernate] INFO: Named query checking : enabled
              [hibernate] Mar 5, 2008 7:11:56 PM org.hibernate.connection.DriverManagerConnect
              ionProvider close
              [hibernate] INFO: cleaning up connection pool: jdbc:postgresql://localhost:5432
              [hibernate] An exception occurred while running exporter #2:hbm2java (Generates
              a set of .java files)
              [hibernate] To get the full stack trace run ant with -verbose
              [hibernate] org.hibernate.exception.GenericJDBCException: Getting database metad
              ata
              [hibernate] org.postgresql.util.PSQLException: FATAL: database "manager" does no
              t exist
              
              BUILD FAILED
              D:\scoala\JAVA\install\jboss-seam-2.1.0.A1\seam-gen\build.xml:1067: org.hibernat
              e.exception.GenericJDBCException: Getting database metadata
              


              • 4. Re: seam generate-entities on 2.1.0A1 problem
                alex_ro_bv

                I hope this gives you a little more infos about my problem... I don't understand because it worked on 2.0.0GA, but I don't have the exact build.properties from then...
                Thank you, Alex.

                • 5. Re: seam generate-entities on 2.1.0A1 problem
                  jbalunas.jbalunas.jboss.org

                  Try specifing the database name as part of the url.


                  The quick look up I did showed the URL pattern


                  jdbc:postgresql://[servername]:[port]/[database] 
                  



                  Perhaps setting it explicitly will help.


                  From what I found the properties are sent directly into the hibernate JDBC ant task, and that is used along with the driver to connect.  Perhaps you could look in hibernate forums/mailing lists as well - I searched quick but could not find anything.

                  • 6. Re: seam generate-entities on 2.1.0A1 problem
                    alex_ro_bv

                    Yap, it did worked :). I've deleted the catalog and inserted into the url like you said and it worked! thank you.