javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: enabled, expected: varchar( 2)

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • I have created reveng.xml file: <hibernate-reverse-engineering> <table catalog="configuration" name="userdb_domain_acl"> <column name="enabled" type="com.siemens.msm.model.mapping.BooleanEnumType" exclude="false"/> </table> </hibernate-reverse-engineering> and included it in build.xml: <jdbcconfiguration propertyfile="build.properties" packagename="${model.package}" revengfile="${project.home}/reveng.xml"/> Generated POJO attribute has proper type, but user type information is missing: @Column(name = "enabled") @Length(max = 42) public Boolean getEnabled() { .... so Hibernate reports error: 3:49:31,397 INFO [TableMetadata] table found: configuration.userdb_domain_acl 13:49:31,397 INFO [TableMetadata] columns: [id, enabled, tablename, domain] 13:49:31,397 WARN [ServiceController] Problem starting service persistence.units:ear=msmgui.ear,unitName=msmgui javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: enabled, expected: varchar( 2) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:698) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127) at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) Annotations should look like this: @Column(name = "enabled") @Type(type="booleanEnum") public Boolean getEnabled() { ...
    via by Zeljko Trogrlic,
  • I have created reveng.xml file: <hibernate-reverse-engineering> <table catalog="configuration" name="userdb_domain_acl"> <column name="enabled" type="com.siemens.msm.model.mapping.BooleanEnumType" exclude="false"/> </table> </hibernate-reverse-engineering> and included it in build.xml: <jdbcconfiguration propertyfile="build.properties" packagename="${model.package}" revengfile="${project.home}/reveng.xml"/> Generated POJO attribute has proper type, but user type information is missing: @Column(name = "enabled") @Length(max = 42) public Boolean getEnabled() { .... so Hibernate reports error: 3:49:31,397 INFO [TableMetadata] table found: configuration.userdb_domain_acl 13:49:31,397 INFO [TableMetadata] columns: [id, enabled, tablename, domain] 13:49:31,397 WARN [ServiceController] Problem starting service persistence.units:ear=msmgui.ear,unitName=msmgui javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: enabled, expected: varchar( 2) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:698) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127) at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) Annotations should look like this: @Column(name = "enabled") @Type(type="booleanEnum") public Boolean getEnabled() { ...
    via by Zeljko Trogrlic,
  • Seam app problem - JBoss 4.2.2 on Windows
    via by Mike Burton,
  • How do I find what persistence.xml is active
    via Stack Overflow by Gert
    ,
  • Unable to build Entity Manager Factory
    via Stack Overflow by Amson
    ,
    • javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: enabled, expected: varchar( 2) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:698) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127) at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    Users with the same issue

    Unknown visitor1 times, last one,
    Piz
    Piz7 times, last one,
    Unknown visitor1 times, last one,