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

Hibernate JIRA | Zeljko Trogrlic | 1 decade ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    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() { ...

    Hibernate JIRA | 1 decade ago | Zeljko Trogrlic
    javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: enabled, expected: varchar( 2)
  2. 0

    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() { ...

    Hibernate JIRA | 1 decade ago | Zeljko Trogrlic
    javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: enabled, expected: varchar( 2)
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Specify member of composite key is foreign key

    Oracle Community | 1 decade ago | 843830
    javax.persistence.PersistenceException: org.hibernate.MappingException: Repeated column in mapping for entity: autosas_ejb.AdvisingFormEntry column: A (should be mapped with insert="false" update="false")

  1. Piz 7 times, last 10 months ago
2 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. javax.persistence.PersistenceException

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

    at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory()
  2. Hibernate EJB
    HibernatePersistence.createContainerEntityManagerFactory
    1. org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:698)
    2. org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
    2 frames
  3. org.jboss.ejb3
    PersistenceUnitDeployment.start
    1. org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264)
    1 frame
  4. Java RT
    NativeMethodAccessorImpl.invoke0
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    1 frame