10 Replies Latest reply on Oct 9, 2007 11:49 AM by nathan dennis

    2.0.0.CR2 Seam-gen Error

    nathan dennis Expert

      downloaded CVS today. tried to build a seam-gen project and ran into trouble getting the meta data from a postgres database.


      [hibernate] INFO: cleaning up connection pool: jdbc:postgresql://localhost/cgdb
      [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.cfg.JDBCBinderException: Could not load MetaDataDialect: org.hibernate.cfg.reveng.dialect.PostgressMetaDataDialect
      [hibernate] java.lang.ClassNotFoundException: org.hibernate.cfg.reveng.dialect.PostgressMetaDataDialect
      [hibernate] A class were not found in the classpath of the Ant task.
      [hibernate] Ensure that the classpath contains the classes needed for Hibernate and your code are in the classpath.
      
      BUILD FAILED
      /usr/local/seamcvs/seam100507/jboss-seam/seam-gen/build.xml:986: org.hibernate.cfg.JDBCBinderException: Could not load MetaDataDialect: org.hibernate.cfg.reveng.dialect.PostgressMetaDataDialect
      
      
      



      not really sure what changed here.... the one obvious thing i noticed is Postgres is spelled with two "s". a typo perhaps??

      any direction with this new error would be greatly appreciated.

        • 1. Re: 2.0.0.CR2 Seam-gen Error
          Art Allisany Newbie

          I had the same problem. Something changed in hibernate-tools.jar

          $ jar tvf ./seam-gen/lib/hibernate-tools.jar | grep ostgr
          $ jar tvf ../seam.old/seam-gen/lib/hibernate-tools.jar | grep ostgr
           678 Thu Nov 09 12:47:22 PST 2006 org/hibernate/cfg/reveng/dialect/PostgressMetaDataDialect.class
          



          In

          ../seam/examples/wiki/lib/hibernate-tools.jar
           678 Thu Nov 09 12:47:22 PST 2006 org/hibernate/cfg/reveng/dialect/PostgressMetaDataDialect.class
          


          PostgressMetaDataDialect is included but I get errors when running seam-gen after overriting :seam-gen/lib/hibernate-tools.jar with examples/wiki/lib/hibernate-tools.jar:

          $ bash seam generate-entities
          ...
          [hibernate] Oct 8, 2007 5:33:10 AM org.hibernate.connection.DriverManagerConnectionProvider close
          [hibernate] INFO: cleaning up connection pool: jdbc:postgresql:cpdb
          [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] java.lang.NullPointerException
          
          BUILD FAILED


          The stack trace was

          java.lang.NullPointerException
           at org.hibernate.cfg.reveng.dialect.PostgressMetaDataDialect.needQuote(PostgressMetaDataDialect.java:7)
           at org.hibernate.cfg.reveng.dialect.AbstractMetaDataDialect.caseForSearch(AbstractMetaDataDialect.java:151)
           at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getTables(JDBCMetaDataDialect.java:22)
           at org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:453)
           at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:74)
          


          Could anyone comment further on what happened in hibername-tools.org and how to fix this?

          • 2. Re: 2.0.0.CR2 Seam-gen Error
            nathan dennis Expert

            hey thanks for the response. nothing knew over this way.....

            i guess we are waiting on one of the gurus to take a look.

            • 3. Re: 2.0.0.CR2 Seam-gen Error
              nathan dennis Expert

              Would Gavin or someone else experience in hibernate please comment on this issue.. i suspect it could be the cause of another hibernate related phenomena that i am experiencing with this new revision...

              • 4. Re: 2.0.0.CR2 Seam-gen Error
                Richard Teviotdale Newbie

                I am also unable to generate-entities with seam 2.0.0.CR2 and postgresql.

                I have a possible work around for the time being:

                1. Create the new project with seam-2.0.0.CR2,
                2. Generate the entities with seam-2.0.0.CR1.

                Appears to work fine after some casual testing. I don't know if there are any changes to the seam-gen jsf facelet templates, so there may be some subtle differences. Hope this helps. Cheers.

                • 5. Re: 2.0.0.CR2 Seam-gen Error
                  Pete Muir Master

                  Dan is away atm, but sent me this

                  Interesting...when I added the H2MetadataDialect I just added all the ones that are available. Looks like there is some sort of problem with the postgres one (aside from the spelling error in the class name). We might want to see if this is a hibernate-tools issue or whether there is something about this person's database that is strange.


                  Please file a JIRA issue so we get this fixed for the GA.

                  • 6. Re: 2.0.0.CR2 Seam-gen Error
                    Max Rydahl Andersen Master

                    I don't recall any PostgressMetaDialect.java been added...something might be fishy with the build.

                    Anyway until I get near the machine that did this build you can work around it by setting

                    hibernatetool.metadatadialect org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect

                    hence overriding any defaulting of postgressdialects.

                    See http://www.hibernate.org/hib_docs/tools/reference/en/html/reverseengineering.html#d0e1770 for what it does.

                    • 7. Re: 2.0.0.CR2 Seam-gen Error
                      nathan dennis Expert

                       

                      "pete.muir@jboss.org" wrote:
                      Dan is away atm, but sent me this

                      Interesting...when I added the H2MetadataDialect I just added all the ones that are available. Looks like there is some sort of problem with the postgres one (aside from the spelling error in the class name). We might want to see if this is a hibernate-tools issue or whether there is something about this person's database that is strange.


                      Please file a JIRA issue so we get this fixed for the GA.


                      A little more info on the database..
                      postgres 8.1.5-13
                      postgresql.jar (JDBC 3) downloaded from postgresql.org

                      im not sure that there is anything strange about the database. it has been running like a rock using the same jar since seam 1.2.

                      i tell you what i have found that is strange.. entities that i had already written to this same database before the upgrade were working fine with RC1 but after the upgrade ,, they will no long persist or update. WITH NO ERROR MESSAGE. ???? but they retrieve just fine. im not sure if the two problems are related. i have some serious red eye going on over here.. i will be glad when all the dust settles. i really want all this new structure in place... because i have a sneaky suspicion it will make all the future upgrades that much easier.


                      i'll go make an attempt at the JIRA on the Dialect issue,,,


                      • 9. Re: 2.0.0.CR2 Seam-gen Error
                        Max Rydahl Andersen Master

                        nathandennis: did you try my suggestion with overriding the hibernatetool.metadatadialect ?

                        btw. it has nothing to do with the db; somehow PostgressDialect made it into the hibernatetools build in seam - I have no idea how (since it is not on my build machine ;(

                        • 10. Re: 2.0.0.CR2 Seam-gen Error
                          nathan dennis Expert

                          yes and the build was successful. thanks for the good idea.

                          but one question, if a generic JDBC dialect will work, how was i benefiting from using a postgres specific dialect??