5 Replies Latest reply on Nov 8, 2007 7:07 AM by Dean Pullen

    Latest SEAM-GEN ERRORS org.hibernate.HibernateException: Wro

    mgrouch Expert

      I get this error trying to bring up a simple app generated with SEAM-GEN.
      I've reversed engineered entities from DB using seam-gen. My DB is Sybase. What could be the reason and how can I fix it?

      org.hibernate.HibernateException: Wrong column type: eventType, expected: varchar(6)


        • 1. Re: Latest SEAM-GEN ERRORS org.hibernate.HibernateException:
          mgrouch Expert

          What could be wrong here?

          @Column(name = "eventType", nullable = false, length = 6)
           @Length(max = 6)
           public String geteventType() {
           return this.eventType;

          • 2. Re: Latest SEAM-GEN ERRORS org.hibernate.HibernateException:
            ir vega Newbie

            I came across a similar Exception with the 1.2.0Patch1 release (I haven't tried this on 1.2.1 yet).
            In short, some fields in my tables were deliberately of type char (rather than varchar) to test out seam-gen and even though the entity beans were reveng'ed by seam-gen, the expected type for those same fields on the deployed app was varchar.
            In my case I was able to fine-tune the schema this time, but I never got an answer to my question about what to do when the schema is fixed (eg a client's legacy app that has some fields defined as char(n)).

            • 3. Re: Latest SEAM-GEN ERRORS org.hibernate.HibernateException:
              mgrouch Expert

              I've got rid of this exception by adding

              import org.hibernate.annotations.Type;
              and this annotation

              @Type(type = "char")

              It goes further, but
              now it is hanging after giving this message

              15:03:11,774 INFO [SchemaValidator] fetching database metadata

              15:03:11,008 INFO [SettingsFactory] RDBMS: Adaptive Server Enterprise, version: Adaptive Server Enterprise/12.5.3/EBF 13528 ESD#7 ONE-OFF/P/Sun_svr4/OS 5.8/ase1253/1950/64-bit/FBO/Mon Apr 24 17:57:35 2006
              15:03:11,008 INFO [SettingsFactory] JDBC driver: jConnect (TM) for JDBC (TM), version: jConnect (TM) for JDBC(TM)/5.5(Build 25827)/P/EBF13045/JDK13/Mon Oct 3 7:31:59 2005
              15:03:11,039 INFO [Dialect] Using dialect: org.hibernate.dialect.SybaseDialect
              15:03:11,055 INFO [TransactionFactoryFactory] Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
              15:03:11,055 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
              15:03:11,071 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
              15:03:11,071 INFO [SettingsFactory] Automatic flush during beforeCompletion(): disabled
              15:03:11,071 INFO [SettingsFactory] Automatic session close at end of transaction: disabled
              15:03:11,071 INFO [SettingsFactory] Scrollable result sets: enabled
              15:03:11,071 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): disabled
              15:03:11,071 INFO [SettingsFactory] Connection release mode: auto
              15:03:11,071 INFO [SettingsFactory] Default batch fetch size: 1
              15:03:11,071 INFO [SettingsFactory] Generate SQL with comments: disabled
              15:03:11,071 INFO [SettingsFactory] Order SQL updates by primary key: disabled
              15:03:11,071 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
              15:03:11,086 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
              15:03:11,086 INFO [SettingsFactory] Query language substitutions: {}
              15:03:11,086 INFO [SettingsFactory] JPA-QL strict compliance: enabled
              15:03:11,086 INFO [SettingsFactory] Second-level cache: enabled
              15:03:11,086 INFO [SettingsFactory] Query cache: disabled
              15:03:11,086 INFO [SettingsFactory] Cache provider: org.hibernate.cache.NoCacheProvider
              15:03:11,086 INFO [SettingsFactory] Optimize cache for minimal puts: disabled
              15:03:11,086 INFO [SettingsFactory] Structured second-level cache entries: disabled
              15:03:11,102 INFO [SettingsFactory] Echoing all SQL to stdout
              15:03:11,102 INFO [SettingsFactory] Statistics: disabled
              15:03:11,102 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
              15:03:11,102 INFO [SettingsFactory] Default entity-mode: pojo
              15:03:11,274 INFO [SessionFactoryImpl] building session factory
              15:03:11,774 INFO [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
              15:03:11,774 INFO [SchemaValidator] Running schema validator
              15:03:11,774 INFO [SchemaValidator] fetching database metadata

              • 4. Re: Latest SEAM-GEN ERRORS org.hibernate.HibernateException:
                mgrouch Expert

                This caused other problems. The workaround that worked is to disable
                ddl schema validation completely


                • 5. Re: Latest SEAM-GEN ERRORS org.hibernate.HibernateException:
                  Dean Pullen Novice

                  Thats the work around, but is there any solution?