New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MappingException: Missing type or column for column[user_role_user_role] on domain[User] referencing[fr.myapp.domain.user.UserRole] #581

Closed
mmaryo opened this Issue Nov 12, 2015 · 14 comments

Comments

Projects
None yet
7 participants
@mmaryo

mmaryo commented Nov 12, 2015

Hi

For no reason, my app cannot run because of GORM Exception.

If I comment the related line, it throw same exception but for another column of another domain
like this
Caused by: org.hibernate.MappingException: Missing type or column for column[hours_request_hours_request] on domain[MerchantRequest] referencing[fr.myapp.domain.merchant.HoursRequest]

My domain classes :

class User implements Serializable {

    private static final long serialVersionUID = 1

    transient springSecurityService
    static transients = ['springSecurityService']

    Long id
    String username
    String email
    String password
    boolean enabled = true
    boolean accountExpired
    boolean accountLocked
    boolean passwordExpired
    Date dateCreated
    Date lastUpdated
    Profile profile

    static hasOne = [
        profile: Profile,
        facebook: UserFacebook
    ]

    static hasMany = [userRole: UserRole]

    static constraints = {
        username unique: true, blank: false, minSize: 4, maxSize: 50
        email unique: true, blank: false, minSize: 4, maxSize: 50, email: true
        password blank: false, minSize: 6/**, maxSize: 30 -> provoque un bug!!, validator: { String password, auth ->
         if (auth.username && auth.username.equals(password)) {return 'auth.password.error.username'}if ( !password.matches('^.*\\p{Alpha}.*$') ||
         !password.matches('^.*\\p{Digit}.*$') ) {return 'auth.password.matches'}}*/
        profile unique: true, nullable: true
        lastUpdated nullable: true
    }

    static mapping = {
        password column: '`password`'
        username index: 'user_username_idx'
        email index: 'user_email_idx'
    }

    Set<Role> getAuthorities() {
        UserRole.findAllByUser(this).collect { it.role } as Set
    }

    def beforeInsert() {
        encodePassword()
    }

    def beforeUpdate() {
        if (isDirty('password')) {
            encodePassword()
        }
    }

    protected void encodePassword() {
        password = springSecurityService.encodePassword(password)
    }

    @Override
    int hashCode() {
        username?.hashCode() ?: 0
    }

    @Override
    boolean equals(other) {
        is(other) || (other instanceof User && other.username == username)
    }

    @Override
    String toString() {
        username
    }

}


class UserRole implements Serializable {

    private static final long serialVersionUID = 1

    Role role
    static belongsTo = [user: User]

    UserRole(User u, Role r) {
        user = u
        role = r
    }

    static constraints = {
        role validator: { Role r, UserRole ur ->
            if (ur.user == null || ur.user.id == null) return
            boolean existing = false
            UserRole.withNewSession {
                existing = UserRole.exists(ur.user.id, r.id)
            }
            if (existing) {
                return 'userRole.exists'
            }
        }
    }

    static mapping = {
        id composite: ['role', 'user']
        version false
    }

    boolean equals(other) {
        if (!(other instanceof UserRole)) {
            return false
        }

        other.user?.id == user?.id &&
                other.role?.id == role?.id
    }

    int hashCode() {
        def builder = new HashCodeBuilder()
        if (user) builder.append(user.id)
        if (role) builder.append(role.id)
        builder.toHashCode()
    }

    static UserRole get(long userId, long roleId) {
        criteriaFor(userId, roleId).get()
    }


    static boolean exists(User user, RoleEnum role) {
        return exists(user.getId(), Role.getByAuthority(role))
    }

    static boolean exists(long userId, long roleId) {
        criteriaFor(userId, roleId).count()
    }

    private static DetachedCriteria criteriaFor(long userId, long roleId) {
        UserRole.where {
            user == User.load(userId) &&
                    role == Role.load(roleId)
        }
    }

    static UserRole createIfNotExists(User user, RoleEnum role, boolean flush = false) {
        if (!hasRole(user, role)) {
            UserRole.create(user, role, flush)
        }
    }

    static UserRole create(User user, RoleEnum role, boolean flush = false) {
        UserRole.create(user, role.toString(), flush)
    }

    static UserRole create(User user, String role, boolean flush = false) {
        UserRole.create(user, Role.getByAuthority(role), flush)
    }

    static UserRole create(User user, Role role, boolean flush = false) {
        if (get(user.getId(), role.getId()) != null) return;
        def instance = new UserRole(user, role)
        instance.save(flush: flush, insert: true)
        instance
    }

    static boolean remove(User u, RoleEnum r, boolean flush = false) {
        return remove(u, Role.getByAuthority(r.toString()), flush)
    }

    static boolean remove(User u, Role r, boolean flush = false) {
        if (u == null || r == null) return false
        int rowCount = UserRole.where { user == u && role == r }.deleteAll()
        if (flush) { UserRole.withSession { it.flush() } }
        rowCount
    }

    static void removeAll(User u, boolean flush = false) {
        if (u == null) return
        UserRole.where { user == u }.deleteAll()
        if (flush) { UserRole.withSession { it.flush() } }
    }

    static void removeAll(Role r, boolean flush = false) {
        if (r == null) return
        UserRole.where { role == r }.deleteAll()
        if (flush) { UserRole.withSession { it.flush() } }
    }

}

I cannot run the app, what can I do ?

This is the stacktrace

/opt/jdk1.8.0_65/bin/java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:49752,suspend=y,server=n -Dvisualvm.id=13595609484115 -noverify -Xverify:none -javaagent:/opt/idea-IU-143.381.42/plugins/Groovy/lib/agent/gragent.jar -Dfile.encoding=UTF-8 -classpath /opt/jdk1.8.0_65/jre/lib/charsets.jar:/opt/jdk1.8.0_65/jre/lib/deploy.jar:/opt/jdk1.8.0_65/jre/lib/ext/cldrdata.jar:/opt/jdk1.8.0_65/jre/lib/ext/dnsns.jar:/opt/jdk1.8.0_65/jre/lib/ext/jaccess.jar:/opt/jdk1.8.0_65/jre/lib/ext/jfxrt.jar:/opt/jdk1.8.0_65/jre/lib/ext/localedata.jar:/opt/jdk1.8.0_65/jre/lib/ext/nashorn.jar:/opt/jdk1.8.0_65/jre/lib/ext/sunec.jar:/opt/jdk1.8.0_65/jre/lib/ext/sunjce_provider.jar:/opt/jdk1.8.0_65/jre/lib/ext/sunpkcs11.jar:/opt/jdk1.8.0_65/jre/lib/ext/zipfs.jar:/opt/jdk1.8.0_65/jre/lib/javaws.jar:/opt/jdk1.8.0_65/jre/lib/jce.jar:/opt/jdk1.8.0_65/jre/lib/jfr.jar:/opt/jdk1.8.0_65/jre/lib/jfxswt.jar:/opt/jdk1.8.0_65/jre/lib/jsse.jar:/opt/jdk1.8.0_65/jre/lib/management-agent.jar:/opt/jdk1.8.0_65/jre/lib/plugin.jar:/opt/jdk1.8.0_65/jre/lib/resources.jar:/opt/jdk1.8.0_65/jre/lib/rt.jar:/home/mario/dev/myapp/myapp/web/build/classes/main:/home/mario/dev/myapp/myapp/web/build/resources/main:/opt/gradle-2.8/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-logging/1.2.6.RELEASE/705098e35b3a95c6353632077702d079e20199cf/spring-boot-starter-logging-1.2.6.RELEASE.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-actuator/1.2.6.RELEASE/225440542e6ef7c577ac65ba7cc1e86041706074/spring-boot-starter-actuator-1.2.6.RELEASE.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-autoconfigure/1.2.6.RELEASE/bfabd0f400672b42fa5ace228341fa77a6a9ba4e/spring-boot-autoconfigure-1.2.6.RELEASE.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-tomcat/1.2.6.RELEASE/83c3287f489e2749d97e725463acc7989002e15/spring-boot-starter-tomcat-1.2.6.RELEASE.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-web-boot/3.0.9/e2d6e578d11cc05f8caf899b6eb91bf0d4f250d3/grails-web-boot-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails.plugins/hibernate/4.3.10.7/252ea1ce72206ed6b4bf61f28eb3595152f0248c/hibernate-4.3.10.7.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails.plugins/cache/3.0.1/7a360b62877f81907d9aa6f76b8019912d3a2031/cache-3.0.1.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.hibernate/hibernate-ehcache/4.3.11.Final/cea0e6aba102c00cf899bd547c338fcf54468433/hibernate-ehcache-4.3.11.Final.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails.plugins/scaffolding/3.1.2/70559775aa9169ee155a70dd1a66f271eccdccee/scaffolding-3.1.2.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails.plugins/spring-security-core/3.0.0.M1/edd31e635d67d65e72b5a7384778e1988a1054d0/spring-security-core-3.0.0.M1.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.4/5fe28b9518e58819180a43a850fbc0dd24b7c050/commons-lang3-3.4.jar:/home/mario/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.12/jcl-over-slf4j-1.7.12.jar:/home/mario/.m2/repository/org/slf4j/jul-to-slf4j/1.7.12/jul-to-slf4j-1.7.12.jar:/home/mario/.m2/repository/org/slf4j/log4j-over-slf4j/1.7.12/log4j-over-slf4j-1.7.12.jar:/home/mario/.m2/repository/ch/qos/logback/logback-classic/1.1.3/logback-classic-1.1.3.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter/1.2.6.RELEASE/95a83e8a81ce873505badb92a61751ac48824922/spring-boot-starter-1.2.6.RELEASE.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-actuator/1.2.6.RELEASE/142f23d9b19ddb0c606dfc9df1421d93e79f27d8/spring-boot-actuator-1.2.6.RELEASE.jar:/home/mario/.m2/repository/org/springframework/spring-core/4.1.7.RELEASE/spring-core-4.1.7.RELEASE.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.springframework.boot/spring-boot/1.2.6.RELEASE/888496de7156692a0eb5685cb18e0f6dd23b1ff4/spring-boot-1.2.6.RELEASE.jar:/home/mario/.m2/repository/org/yaml/snakeyaml/1.14/snakeyaml-1.14.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-core/8.0.26/33a945c55939d39c5b3f5f5ce91e7d16bc6116e8/tomcat-embed-core-8.0.26.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-el/8.0.26/8b090d3dccb292b83c03b990f109bf5ceace50ca/tomcat-embed-el-8.0.26.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-logging-juli/8.0.26/9d55e3b1751b1ddacf3b5108b4ec9fcaee380fba/tomcat-embed-logging-juli-8.0.26.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-websocket/8.0.26/83628f454a82ee1d33daaa1d53e635405e4c12c3/tomcat-embed-websocket-8.0.26.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-bootstrap/3.0.9/4c877092fcbc4a2e9cec538fa0daa22396ea1221/grails-bootstrap-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-plugin-rest/3.0.9/6cc520c20fbb46c8cc04689390df568659bab61/grails-plugin-rest-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-plugin-databinding/3.0.9/b48c26df8bef8b5ef382c892e5238f6d2c2c284/grails-plugin-databinding-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-plugin-i18n/3.0.9/61a4b52adc63d1c0b004f4589eb42c1da666e55b/grails-plugin-i18n-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-plugin-filters/3.0.9/233a69afe2036d543e4922c06f55bfd7c75fd664/grails-plugin-filters-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-plugin-gsp/3.0.9/123055121c92e0f2242e225a3204ec96d3bd26a9/grails-plugin-gsp-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-plugin-services/3.0.9/6228151e6af140603dcf2f6fa1aa59c44709677a/grails-plugin-services-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-plugin-url-mappings/3.0.9/4a7fb37f8fce82e7bc70253acecb9eb6ecd3a49a/grails-plugin-url-mappings-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-plugin-interceptors/3.0.9/d3ec73124762cae052cdf06b450222b8a58a2cde/grails-plugin-interceptors-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-plugin-async/3.0.9/fcc550590bd3d9663b454bc024d4ec419fc7f007/grails-plugin-async-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/com.h2database/h2/1.3.176/fd369423346b2f1525c413e33f8cf95b09c92cbd/h2-1.3.176.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.codehaus.groovy/groovy/2.4.5/4c7cd3b294af0a32609402c9d12ccc4218890e12/groovy-2.4.5.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-web-common/3.0.9/e827f35c12e72309956997baddbb360b8d4b38ba/grails-web-common-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-datastore-gorm-hibernate4/4.0.7.RELEASE/fda9cb99545b213e60c64bebfec651203ecd0df7/grails-datastore-gorm-hibernate4-4.0.7.RELEASE.jar:/home/mario/.m2/repository/com/googlecode/concurrentlinkedhashmap/concurrentlinkedhashmap-lru/1.4/concurrentlinkedhashmap-lru-1.4.jar:/home/mario/.m2/repository/org/jboss/logging/jboss-logging/3.1.3.GA/jboss-logging-3.1.3.GA.jar:/home/mario/.m2/repository/org/jboss/logging/jboss-logging-annotations/1.2.0.Beta1/jboss-logging-annotations-1.2.0.Beta1.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.hibernate/hibernate-core/4.3.11.Final/536ac0021240d97db99c7d2983067cef1a6f3af5/hibernate-core-4.3.11.Final.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/net.sf.ehcache/ehcache-core/2.4.3/fd258ef6959f27fb678b04f90139ded4588e2d15/ehcache-core-2.4.3.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails.plugins/fields/2.1.0/670b525afca7dffd7c5a73b7baecb441fab4c2e8/fields-2.1.0.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.springframework.security/spring-security-core/3.2.8.RELEASE/36028a35ca93f504dfc2484dc12e5b00a42bc54b/spring-security-core-3.2.8.RELEASE.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.springframework.security/spring-security-web/3.2.8.RELEASE/55f8d16b6fdfad43eb43e0c3f8b3a269c1997d79/spring-security-web-3.2.8.RELEASE.jar:/home/mario/.m2/repository/net/sf/ehcache/ehcache/2.9.0/ehcache-2.9.0.jar:/home/mario/.m2/repository/ch/qos/logback/logback-core/1.1.3/logback-core-1.1.3.jar:/home/mario/.m2/repository/org/springframework/spring-context/4.1.7.RELEASE/spring-context-4.1.7.RELEASE.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-xml/2.4.5/bbbb0cdd8a566362454372adb1601f0c052e51c6/groovy-xml-2.4.5.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-web/3.0.9/de9d39704fbacd42e3fa596020b0384921bc6ec7/grails-web-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-plugin-datasource/3.0.9/493c46792f426d91236b36bd4d821ce2db0ff2f4/grails-plugin-datasource-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-plugin-controllers/3.0.9/3ce2c16cb56505bcdff729126835f88d6029c130/grails-plugin-controllers-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-core/3.0.9/2b7e80af2fd277baded711cf5b94af0b9a8bf15b/grails-core-3.0.9.jar:/home/mario/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-web-gsp-taglib/3.0.9/fc2ca2f8461aee3a90a1d37c29fa72154fca230/grails-web-gsp-taglib-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-logging/3.0.9/2a997e860869f6554b2091e3e0e1e344129637fb/grails-logging-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-plugin-codecs/3.0.9/bd3bdc41677a02ec26ed6e2f9b64aa4a83ec748e/grails-plugin-codecs-3.0.9.jar:/home/mario/.m2/repository/org/springframework/spring-tx/4.1.7.RELEASE/spring-tx-4.1.7.RELEASE.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-plugin-events/3.0.9/f852193d4afd8d13c7cfa86197bf66866aec2cfe/grails-plugin-events-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-validation/3.0.9/2d4e48e14f62537f5643ecbb8c64f71cf38d1031/grails-validation-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.springframework/spring-context-support/4.1.7.RELEASE/db508937a1033bd3267e57566044df705076dc6/spring-context-support-4.1.7.RELEASE.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-encoder/3.0.9/de48588465e8206d80c87acd7894f4c3300de95/grails-encoder-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-databinding/3.0.9/49544b296939a75a53759d3b39a2e8343990c207/grails-databinding-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-templates/2.4.5/7e125934b98430ba7a80ffea2150f59dfdf71978/groovy-templates-2.4.5.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-gsp/3.0.9/687ae5bb33990ad72250b57d45df192abfde9346/grails-gsp-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.springframework/spring-webmvc/4.1.7.RELEASE/b6b9f604cb2223251cae67fff7ca2b1d9ff1c2d8/spring-webmvc-4.1.7.RELEASE.jar:/home/mario/.m2/repository/org/hibernate/hibernate-validator/5.0.3.Final/hibernate-validator-5.0.3.Final.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.hibernate.common/hibernate-commons-annotations/4.0.5.Final/2a581b9edb8168e45060d8bad8b7f46712d2c52c/hibernate-commons-annotations-4.0.5.Final.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-datastore-gorm-hibernate-core/4.0.7.RELEASE/8845ddb7d5dc807201a5065f6375e5a13e2d9b0b/grails-datastore-gorm-hibernate-core-4.0.7.RELEASE.jar:/home/mario/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar:/home/mario/.m2/repository/org/springframework/spring-aop/4.1.7.RELEASE/spring-aop-4.1.7.RELEASE.jar:/home/mario/.m2/repository/org/springframework/spring-beans/4.1.7.RELEASE/spring-beans-4.1.7.RELEASE.jar:/home/mario/.m2/repository/org/springframework/spring-expression/4.1.7.RELEASE/spring-expression-4.1.7.RELEASE.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-web-url-mappings/3.0.9/93da24f625113f3395b0188b498ce6ad357560b3/grails-web-url-mappings-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-web-gsp/3.0.9/5821bba159df3151fd3781bfcd2a9251df9005dc/grails-web-gsp-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-web-mvc/3.0.9/122cdf12141a07da44bf58ec1342f164c089b249/grails-web-mvc-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-web-jsp/3.0.9/770b6a58a7879bae3150f2ffcc7fec2264261961/grails-web-jsp-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-web-sitemesh/3.0.9/327a5da810e34116bb380110233646f5a2239071/grails-web-sitemesh-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-web-databinding/3.0.9/fe946b1cb1fdc2cbc9effaf370daae064c3e244/grails-web-databinding-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-web-fileupload/3.0.9/516fabdc91e89a00b5bbc694e93b2996455955d1/grails-web-fileupload-3.0.9.jar:/home/mario/.m2/repository/org/springframework/spring-jdbc/4.1.7.RELEASE/spring-jdbc-4.1.7.RELEASE.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.apache.tomcat/tomcat-jdbc/7.0.55/3d00af6b2e5de5fa2df7bd7c7ec910495c774138/tomcat-jdbc-7.0.55.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-sql/2.4.5/a8a1b9eb0a1282940b4d41a43ca5df5178d70fb3/groovy-sql-2.4.5.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-plugin-validation/3.0.9/3f6d1d75315c6a5e66b3e82643cdb2c1533ee4ab/grails-plugin-validation-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-plugin-mimetypes/3.0.9/53cb4bb671863da99a5f5e55612e8fd8797c583d/grails-plugin-mimetypes-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-async/3.0.9/3b6b740dd4c95b6bf6647ec05ff6ac2507523fdb/grails-async-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-plugin-domain-class/3.0.9/b243fe02bb2bae0e5b495847d9b85a88706ef3b3/grails-plugin-domain-class-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-plugin-converters/3.0.9/dda6f99c416e8b779d4d546429381dcf4ab2f14a/grails-plugin-converters-3.0.9.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.springframework/spring-aspects/4.1.7.RELEASE/7bba74bc38abf8fdaa8ad8288574edb4430ed490/spring-aspects-4.1.7.RELEASE.jar:/home/mario/.m2/repository/org/aspectj/aspectjrt/1.8.5/aspectjrt-1.8.5.jar:/home/mario/.m2/repository/org/apache/tomcat/embed/tomcat-embed-logging-log4j/7.0.55/tomcat-embed-logging-log4j-7.0.55.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-spring/3.0.9/c35836b622564d3847a99cfcd977afa93fbc9391/grails-spring-3.0.9.jar:/home/mario/.m2/repository/org/hibernate/javax/persistence/hibernate-jpa-2.1-api/1.0.0.Final/hibernate-jpa-2.1-api-1.0.0.Final.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/xalan/serializer/2.7.2/24247f3bb052ee068971393bdb83e04512bb1c3c/serializer-2.7.2.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/io.projectreactor/reactor-bus/2.0.6.RELEASE/777a92012c60278a98311e2aa787dc8eeced758d/reactor-bus-2.0.6.RELEASE.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/io.projectreactor.spring/reactor-spring-context/2.0.6.RELEASE/1408e5ae689d3aca8b910ad2f39fce080a646feb/reactor-spring-context-2.0.6.RELEASE.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/commons-validator/commons-validator/1.4.1/2231238e391057a53f92bde5bbc588622c1956c3/commons-validator-1.4.1.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-json/2.4.5/ff21b54d65128ff46488286af056eed606481f97/groovy-json-2.4.5.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.springframework/spring-web/4.1.7.RELEASE/2d9245006b788d7d6afeec85a43e4bfe2e46340a/spring-web-4.1.7.RELEASE.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-taglib/3.0.9/ce82f5557ed1831d469f063657184556b6dae4f0/grails-taglib-3.0.9.jar:/home/mario/.m2/repository/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final.jar:/home/mario/.m2/repository/com/fasterxml/classmate/1.0.0/classmate-1.0.0.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-datastore-gorm-plugin-support/4.0.7.RELEASE/1026cd86782451c6cb903439fcbbffc267cc58bb/grails-datastore-gorm-plugin-support-4.0.7.RELEASE.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.springframework/spring-orm/4.1.7.RELEASE/d8923bdffe631904899875e719d8b363bc3deaea/spring-orm-4.1.7.RELEASE.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-datastore-core/4.0.7.RELEASE/e492ba4ea39fe4aa3a2c980226acfad6600ad118/grails-datastore-core-4.0.7.RELEASE.jar:/home/mario/.m2/repository/javax/transaction/jta/1.1/jta-1.1.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-datastore-gorm/4.0.7.RELEASE/3e2242670dbcdcd915a94b438c013ff5815f4b99/grails-datastore-gorm-4.0.7.RELEASE.jar:/home/mario/.m2/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar:/home/mario/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-web-taglib/3.0.9/ed2bf00d65a2b14969bba8f4b36505120d23be5/grails-web-taglib-3.0.9.jar:/home/mario/.m2/repository/opensymphony/sitemesh/2.4/sitemesh-2.4.jar:/home/mario/.m2/repository/commons-fileupload/commons-fileupload/1.3.1/commons-fileupload-1.3.1.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.apache.tomcat/tomcat-juli/7.0.55/7b0d3759db33865f882e77bdddb87c3cb28cecc3/tomcat-juli-7.0.55.jar:/home/mario/.m2/repository/org/codehaus/gpars/gpars/1.2.1/gpars-1.2.1.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/io.projectreactor/reactor-stream/2.0.6.RELEASE/d41c8242ea2dcb0d2c661ad0ff9c25401501b861/reactor-stream-2.0.6.RELEASE.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/io.projectreactor/reactor-core/2.0.6.RELEASE/a36e58c9d2d0ac1f47e17e8db60a7ebb9d09789c/reactor-core-2.0.6.RELEASE.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails/grails-datastore-simple/4.0.7.RELEASE/851f3f8ef2d46b126b248367298ff9ee5e31a6ce/grails-datastore-simple-4.0.7.RELEASE.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-ant/2.4.5/da3bf324dd8480f6f94e6f6a6af3fdea7cc03af4/groovy-ant-2.4.5.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/com.goldmansachs/gs-collections/5.1.0/7114c5349c816ea645b1ea3ffcc21fa073cbabc/gs-collections-5.1.0.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/com.jayway.jsonpath/json-path/0.9.0/eb4e9cbfc09133cfe3101d5a70cfa35d8b71eeec/json-path-0.9.0.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/io.projectreactor.spring/reactor-spring-core/2.0.6.RELEASE/8eb6c6f4df6e40bf5caff119374e71b0cb8351e8/reactor-spring-core-2.0.6.RELEASE.jar:/home/mario/.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar:/home/mario/.m2/repository/commons-io/commons-io/2.2/commons-io-2.2.jar:/home/mario/.m2/repository/org/codehaus/jsr166-mirror/jsr166y/1.7.0/jsr166y-1.7.0.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.reactivestreams/reactive-streams/1.0.0/14b8c877d98005ba3941c9257cfe09f6ed0e0d74/reactive-streams-1.0.0.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.apache.ant/ant/1.9.4/6d473e8653d952045f550f4ef225a9591b79094a/ant-1.9.4.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-groovydoc/2.4.5/ab5ed761a967b9a42bca862f037816215de9287e/groovy-groovydoc-2.4.5.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.apache.ant/ant-antlr/1.9.4/4cf30025981dc2344324a0ef0e40063c3ef08f0a/ant-antlr-1.9.4.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.apache.ant/ant-launcher/1.9.4/334b62cb4be0432769679e8b94e83f8fd5ed395c/ant-launcher-1.9.4.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.apache.ant/ant-junit/1.9.4/b063757dacaa716b643c2f9270e469183636ff11/ant-junit-1.9.4.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/com.goldmansachs/gs-collections-api/5.1.0/ea605cdf64cab5fc7b48c99f061d4c8db05b6ff1/gs-collections-api-5.1.0.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/net.minidev/json-smart/1.2/199828b0a7be9626c6eaecb005baddd24bfddc1f/json-smart-1.2.jar:/home/mario/.m2/repository/org/slf4j/slf4j-api/1.7.12/slf4j-api-1.7.12.jar:/home/mario/.m2/repository/org/jboss/spec/javax/transaction/jboss-transaction-api_1.2_spec/1.0.0.Final/jboss-transaction-api_1.2_spec-1.0.0.Final.jar:/home/mario/.m2/repository/org/jboss/jandex/1.1.0.Final/jandex-1.1.0.Final.jar:/home/mario/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar:/home/mario/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.aspectj/aspectjweaver/1.8.6/7108cf65148f29a55ebf23db2c46224ea9d086dc/aspectjweaver-1.8.6.jar:/home/mario/.m2/repository/org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.grails.plugins/asset-pipeline/3.0.8/95bf23fd5e4bed45ff56328cc395ca695d76f498/asset-pipeline-3.0.8.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/mysql/mysql-connector-java/5.1.37/2c378637f6faff77541244e8257b446f04324bd8/mysql-connector-java-5.1.37.jar:/home/mario/.m2/repository/org/mozilla/rhino/1.7R4/rhino-1.7R4.jar:/home/mario/.m2/repository/com/bertramlabs/plugins/asset-pipeline-core/2.5.0/asset-pipeline-core-2.5.0.jar:/home/mario/.m2/repository/com/google/javascript/closure-compiler/v20141023/closure-compiler-v20141023.jar:/home/mario/.m2/repository/com/google/javascript/closure-compiler-externs/v20141023/closure-compiler-externs-v20141023.jar:/home/mario/.m2/repository/args4j/args4j/2.0.26/args4j-2.0.26.jar:/home/mario/.m2/repository/com/google/guava/guava/18.0/guava-18.0.jar:/home/mario/.m2/repository/com/google/protobuf/protobuf-java/2.5.0/protobuf-java-2.5.0.jar:/home/mario/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar:/home/mario/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar:/home/mario/.m2/repository/org/imgscalr/imgscalr-lib/4.2/imgscalr-lib-4.2.jar:/home/mario/.m2/repository/org/springframework/social/spring-social-config/1.1.2.RELEASE/spring-social-config-1.1.2.RELEASE.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/org.springframework.social/spring-social-security/1.1.2.RELEASE/3bc711638cb9a8d98a3ad4b4b57ec3461fcb889c/spring-social-security-1.1.2.RELEASE.jar:/home/mario/.m2/repository/org/springframework/social/spring-social-web/1.1.2.RELEASE/spring-social-web-1.1.2.RELEASE.jar:/home/mario/.m2/repository/org/springframework/social/spring-social-core/1.1.2.RELEASE/spring-social-core-1.1.2.RELEASE.jar:/home/mario/.m2/repository/org/springframework/social/spring-social-facebook/2.0.1.RELEASE/spring-social-facebook-2.0.1.RELEASE.jar:/home/mario/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.4.5/jackson-annotations-2.4.5.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.4.6/3e63a25de4065697b185f523ed5e020c0db3ff0/jackson-databind-2.4.6.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.4.6/2a1f6edb86b8c6d29f37f6a807295d4e5c279707/jackson-core-2.4.6.jar:/home/mario/.m2/repository/org/apache/httpcomponents/httpclient/4.5/httpclient-4.5.jar:/home/mario/.m2/repository/com/google/code/gson/gson/2.3.1/gson-2.3.1.jar:/home/mario/.m2/repository/org/apache/httpcomponents/httpcore/4.4.1/httpcore-4.4.1.jar:/home/mario/.m2/repository/commons-codec/commons-codec/1.9/commons-codec-1.9.jar:/home/mario/dev/myapp/myapp/web/libs/mailjet-1.2.0.jar:/opt/gradle-2.8/caches/modules-2/files-2.1/com.restfb/restfb/1.16.0/75c804bd8534d89b95880791970360d41fab2103/restfb-1.16.0.jar:/opt/idea-IU-143.381.42/lib/idea_rt.jar web.Application
Connected to the target VM, address: '127.0.0.1:49752', transport: 'socket'

Configuring Spring Security Core ...
... finished configuring Spring Security Core

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.MappingException: Missing type or column for column[user_role_user_role] on domain[User] referencing[fr.myapp.domain.user.UserRole]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:199)
    at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:615)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:465)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:687)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
    at grails.boot.GrailsApp.run(GrailsApp.groovy:52)
    at grails.boot.GrailsApp.run(GrailsApp.groovy:330)
    at grails.boot.GrailsApp.run(GrailsApp.groovy:319)
    at grails.boot.GrailsApp$run.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
    at web.Application.main(Application.groovy:10)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.MappingException: Missing type or column for column[user_role_user_role] on domain[User] referencing[fr.myapp.domain.user.UserRole]
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1477)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1222)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
    at org.grails.transaction.TransactionManagerPostProcessor.initialize(TransactionManagerPostProcessor.java:75)
    at org.grails.transaction.TransactionManagerPostProcessor.setBeanFactory(TransactionManagerPostProcessor.java:53)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeAwareMethods(AbstractAutowireCapableBeanFactory.java:1593)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1561)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
    ... 19 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.MappingException: Missing type or column for column[user_role_user_role] on domain[User] referencing[fr.myapp.domain.user.UserRole]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
    ... 33 more
Caused by: org.hibernate.MappingException: Missing type or column for column[user_role_user_role] on domain[User] referencing[fr.myapp.domain.user.UserRole]
    at org.grails.orm.hibernate.cfg.AbstractGrailsDomainBinder.bindCollectionWithJoinTable(AbstractGrailsDomainBinder.java:709)
    at org.grails.orm.hibernate.cfg.AbstractGrailsDomainBinder.bindCollectionSecondPass(AbstractGrailsDomainBinder.java:513)
    at org.grails.orm.hibernate.cfg.AbstractGrailsDomainBinder$GrailsCollectionSecondPass.doSecondPass(AbstractGrailsDomainBinder.java:166)
Disconnected from the target VM, address: '127.0.0.1:49752', transport: 'socket'
    at org.hibernate.cfg.Configuration.originalSecondPassCompile(Configuration.java:1697)
    at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1426)
    at org.grails.orm.hibernate.cfg.GrailsAnnotationConfiguration.secondPassCompile(GrailsAnnotationConfiguration.java:194)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1846)
    at org.grails.orm.hibernate.cfg.GrailsAnnotationConfiguration.buildSessionFactory(GrailsAnnotationConfiguration.java:407)
    at org.grails.orm.hibernate.ConfigurableLocalSessionFactoryBean.doBuildSessionFactory(ConfigurableLocalSessionFactoryBean.java:479)
    at org.grails.orm.hibernate.ConfigurableLocalSessionFactoryBean.buildSessionFactory(ConfigurableLocalSessionFactoryBean.java:473)
    at org.grails.orm.hibernate.ConfigurableLocalSessionFactoryBean.afterPropertiesSet(ConfigurableLocalSessionFactoryBean.java:387)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
    ... 40 more
ERROR grails.boot.GrailsApp - Application startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.MappingException: Missing type or column for column[user_role_user_role] on domain[User] referencing[fr.myapp.domain.user.UserRole]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:199) ~[spring-context-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:615) ~[spring-context-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:465) ~[spring-context-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) ~[spring-boot-1.2.6.RELEASE.jar:1.2.6.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:687) ~[spring-boot-1.2.6.RELEASE.jar:1.2.6.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:321) ~[spring-boot-1.2.6.RELEASE.jar:1.2.6.RELEASE]
    at grails.boot.GrailsApp.run(GrailsApp.groovy:52) [grails-core-3.0.9.jar:3.0.9]
    at grails.boot.GrailsApp.run(GrailsApp.groovy:330) [grails-core-3.0.9.jar:3.0.9]
    at grails.boot.GrailsApp.run(GrailsApp.groovy:319) [grails-core-3.0.9.jar:3.0.9]
    at grails.boot.GrailsApp$run.call(Unknown Source) [grails-core-3.0.9.jar:3.0.9]
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) [groovy-2.4.5.jar:2.4.5]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) [groovy-2.4.5.jar:2.4.5]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133) [groovy-2.4.5.jar:2.4.5]
    at web.Application.main(Application.groovy:10) [main/:na]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.MappingException: Missing type or column for column[user_role_user_role] on domain[User] referencing[fr.myapp.domain.user.UserRole]
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1477) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1222) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.grails.transaction.TransactionManagerPostProcessor.initialize(TransactionManagerPostProcessor.java:75) ~[grails-core-3.0.9.jar:3.0.9]
    at org.grails.transaction.TransactionManagerPostProcessor.setBeanFactory(TransactionManagerPostProcessor.java:53) ~[grails-core-3.0.9.jar:3.0.9]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeAwareMethods(AbstractAutowireCapableBeanFactory.java:1593) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1561) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    ... 19 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.MappingException: Missing type or column for column[user_role_user_role] on domain[User] referencing[fr.myapp.domain.user.UserRole]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    ... 33 common frames omitted
Caused by: org.hibernate.MappingException: Missing type or column for column[user_role_user_role] on domain[User] referencing[fr.myapp.domain.user.UserRole]
    at org.grails.orm.hibernate.cfg.AbstractGrailsDomainBinder.bindCollectionWithJoinTable(AbstractGrailsDomainBinder.java:709) ~[grails-datastore-gorm-hibernate-core-4.0.7.RELEASE.jar:na]
    at org.grails.orm.hibernate.cfg.AbstractGrailsDomainBinder.bindCollectionSecondPass(AbstractGrailsDomainBinder.java:513) ~[grails-datastore-gorm-hibernate-core-4.0.7.RELEASE.jar:na]
    at org.grails.orm.hibernate.cfg.AbstractGrailsDomainBinder$GrailsCollectionSecondPass.doSecondPass(AbstractGrailsDomainBinder.java:166) ~[grails-datastore-gorm-hibernate-core-4.0.7.RELEASE.jar:na]
    at org.hibernate.cfg.Configuration.originalSecondPassCompile(Configuration.java:1697) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1426) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.grails.orm.hibernate.cfg.GrailsAnnotationConfiguration.secondPassCompile(GrailsAnnotationConfiguration.java:194) ~[grails-datastore-gorm-hibernate4-4.0.7.RELEASE.jar:na]
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1846) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.grails.orm.hibernate.cfg.GrailsAnnotationConfiguration.buildSessionFactory(GrailsAnnotationConfiguration.java:407) ~[grails-datastore-gorm-hibernate4-4.0.7.RELEASE.jar:na]
    at org.grails.orm.hibernate.ConfigurableLocalSessionFactoryBean.doBuildSessionFactory(ConfigurableLocalSessionFactoryBean.java:479) ~[grails-datastore-gorm-hibernate4-4.0.7.RELEASE.jar:na]
    at org.grails.orm.hibernate.ConfigurableLocalSessionFactoryBean.buildSessionFactory(ConfigurableLocalSessionFactoryBean.java:473) ~[grails-datastore-gorm-hibernate4-4.0.7.RELEASE.jar:na]
    at org.grails.orm.hibernate.ConfigurableLocalSessionFactoryBean.afterPropertiesSet(ConfigurableLocalSessionFactoryBean.java:387) ~[grails-datastore-gorm-hibernate4-4.0.7.RELEASE.jar:na]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    ... 40 common frames omitted

Process finished with exit code 1
@mmaryo

This comment has been minimized.

Show comment
Hide comment
@mmaryo

mmaryo Nov 14, 2015

Now it works, but I change nothing

mmaryo commented Nov 14, 2015

Now it works, but I change nothing

@mmaryo

This comment has been minimized.

Show comment
Hide comment
@mmaryo

mmaryo Nov 14, 2015

and now it's not working

Caused by: org.hibernate.MappingException: Missing type or column for column[products_product] on domain[Menu] referencing[fr.myapp.domain.order.Product]
at org.hibernate.cfg.Configuration.originalSecondPassCompile(Configuration.java:1697)

I juste added some java and groovy classes in src folder
and dependency to 'org.elasticsearch:elasticsearch:2.0.0'

mmaryo commented Nov 14, 2015

and now it's not working

Caused by: org.hibernate.MappingException: Missing type or column for column[products_product] on domain[Menu] referencing[fr.myapp.domain.order.Product]
at org.hibernate.cfg.Configuration.originalSecondPassCompile(Configuration.java:1697)

I juste added some java and groovy classes in src folder
and dependency to 'org.elasticsearch:elasticsearch:2.0.0'

@bond-

This comment has been minimized.

Show comment
Hide comment
@bond-

bond- Nov 24, 2015

Contributor

@mariomatar If you are working on a development environment then I suggest that you drop your database and restart your application.

Also consider adding database-migration plugin and it's configuration for versioning of your database.

Contributor

bond- commented Nov 24, 2015

@mariomatar If you are working on a development environment then I suggest that you drop your database and restart your application.

Also consider adding database-migration plugin and it's configuration for versioning of your database.

@alex-shamshurin

This comment has been minimized.

Show comment
Hide comment
@alex-shamshurin

alex-shamshurin Dec 2, 2015

Please check if your domain class table exists in the recreated database. Under some conditions table may not be created with "It is not a Domain" error (you can see this error at runtime too if you try to change that domain class).So when related table does not exist, the exception "MappingException: Missing type or column for column" is rised.

So problem is in "It is not a Domain" issue, It is also happened after I added some deps to gradle.build
Grails 3.0.9

ERROR org.grails.plugins.AbstractGrailsPluginManager - Plugin [domainClass:3.0.9] could not reload changes to file [C:\Users\username\workspace\myproject\grails-app\domain\com\myproject\gorm\block\BlockJob.groovy]: Cannot add Domain class [class com.myproject.gorm.block.BlockJob]. It is not a Domain!
org.grails.core.exceptions.GrailsConfigurationException: Cannot add Domain class [class com.myproject.gorm.block.BlockJob]. It is not a Domain!

It seems that a problem is in a domain name. In my case some other class is somewhere with a name "BlockJob". May be.

alex-shamshurin commented Dec 2, 2015

Please check if your domain class table exists in the recreated database. Under some conditions table may not be created with "It is not a Domain" error (you can see this error at runtime too if you try to change that domain class).So when related table does not exist, the exception "MappingException: Missing type or column for column" is rised.

So problem is in "It is not a Domain" issue, It is also happened after I added some deps to gradle.build
Grails 3.0.9

ERROR org.grails.plugins.AbstractGrailsPluginManager - Plugin [domainClass:3.0.9] could not reload changes to file [C:\Users\username\workspace\myproject\grails-app\domain\com\myproject\gorm\block\BlockJob.groovy]: Cannot add Domain class [class com.myproject.gorm.block.BlockJob]. It is not a Domain!
org.grails.core.exceptions.GrailsConfigurationException: Cannot add Domain class [class com.myproject.gorm.block.BlockJob]. It is not a Domain!

It seems that a problem is in a domain name. In my case some other class is somewhere with a name "BlockJob". May be.

@mjcmatrix

This comment has been minimized.

Show comment
Hide comment
@mjcmatrix

mjcmatrix Jan 6, 2016

I've been struggling with this issue for weeks too. I am trying to migrate a Grails 2.4 project to 3.1.0.RC1. Domain classes are not all recognised sometimes at runtime and this is the error on all classes. Adding @entity resolves this particular error but is not a fix.

I am currently working with a set of several simple test projects with a few simple template domain classes to try to identify the root cause of this.

mjcmatrix commented Jan 6, 2016

I've been struggling with this issue for weeks too. I am trying to migrate a Grails 2.4 project to 3.1.0.RC1. Domain classes are not all recognised sometimes at runtime and this is the error on all classes. Adding @entity resolves this particular error but is not a fix.

I am currently working with a set of several simple test projects with a few simple template domain classes to try to identify the root cause of this.

@graemerocher

This comment has been minimized.

Show comment
Hide comment
@graemerocher

graemerocher Jan 8, 2016

Member

@mjcmatrix Please provide an example with steps to reproduce and we can take a look

Member

graemerocher commented Jan 8, 2016

@mjcmatrix Please provide an example with steps to reproduce and we can take a look

@mjcmatrix

This comment has been minimized.

Show comment
Hide comment
@mjcmatrix

mjcmatrix Jan 9, 2016

A problem I have returned to repeatedly when migrating a domain model is that under some circumstances GORM fails to detect or register some of the entity classes in grails-app/domain as Hibernate Entities.

No log messages are output about the classes it does not register. That makes it extremely difficult to debug. #620 is the only cause of this scenario occurring I have pinpointed so far (but I believe there could be other causes).

I noticed after a while (with debug logging on) that a message is seen in the startup log, before seeing exceptions like those experienced by the OP, that reveals that this is going on. (I have 73 domain classes.)

DEBUG org.grails.orm.hibernate.cfg.HibernateMappingContextConfiguration - [GrailsAnnotationConfiguration] [**4**] Grails domain classes to bind to persistence runtime

Grails then goes on to map only the classes it has registered as entities: only 4 out of 73 in my case.

DEBUG org.grails.orm.hibernate.cfg.HibernateMappingContextConfiguration - [GrailsAnnotationConfiguration] Binding persistent class [co.jnet.core.domain.RoleGroupRole]
...

Once you notice that Grails has only bound a limited number of domain classes then the exceptions about associations immediately make sense. (In my case the only successful domain classes in this scenario are the simple classes such as many-to-many association classes, e.g. RoleGroupRole, that have no base class.)

I have been looking at the AST code (GormEntityTransformation and AstUtils) to understand the eligibility criteria for configuring domain classes as entities and also to see if any relevant logs or compiler warnings are generated in the process that I could get sight of.

To be honest I am on the cusp of abandoning my Grails 3 branch until at least #620 and this issue #581 are resolved as I cannot migrate the app. These issues are blockers for me. From a business perspective I haven't progressed my project in over 6 weeks while attempting to upgrade. 90% of this time has been spent debugging after my application of typical design patterns for a non-trivial app, this is quite similar actually to my initial entry experience to Grails 2.1, which was some time ago. I think I have to return to Grails 2.4 for now.

I am very fond of Grails but I seem to be one of those developers that pushes the boundaries of what it can do a bit and gets burnt. I have spent many hours dealing with unexpected limitations and issues during my Grails journey instead of writing business logic which has diminished the promise of RAD that drew me to the Grails world in the first place. Still, I accept this is an evolving and complex framework that can't do everything and it needs support from users pushing the boundaries in order to get there. I am looking forward to having a working app in the Grails 3 landscape once I finally get my apps migrated.

There are many good things about Grails 3 and I still believe that Groovy and Grails are the language and framework for most of my projects. I am an advocate. (I attended the Devoxx 2015 conference in London and a respected developer who was delivering a talk on languages after solving a programming problem in many different languages, concluded that we should all be developing in Groovy, which I found very pleasing and is completely aligned with my view.)

For a test scenario simply take the test app I uploaded on #620 and declare a field UUID id on the abstract base class. This will reproduce this OP's issue.

mjcmatrix commented Jan 9, 2016

A problem I have returned to repeatedly when migrating a domain model is that under some circumstances GORM fails to detect or register some of the entity classes in grails-app/domain as Hibernate Entities.

No log messages are output about the classes it does not register. That makes it extremely difficult to debug. #620 is the only cause of this scenario occurring I have pinpointed so far (but I believe there could be other causes).

I noticed after a while (with debug logging on) that a message is seen in the startup log, before seeing exceptions like those experienced by the OP, that reveals that this is going on. (I have 73 domain classes.)

DEBUG org.grails.orm.hibernate.cfg.HibernateMappingContextConfiguration - [GrailsAnnotationConfiguration] [**4**] Grails domain classes to bind to persistence runtime

Grails then goes on to map only the classes it has registered as entities: only 4 out of 73 in my case.

DEBUG org.grails.orm.hibernate.cfg.HibernateMappingContextConfiguration - [GrailsAnnotationConfiguration] Binding persistent class [co.jnet.core.domain.RoleGroupRole]
...

Once you notice that Grails has only bound a limited number of domain classes then the exceptions about associations immediately make sense. (In my case the only successful domain classes in this scenario are the simple classes such as many-to-many association classes, e.g. RoleGroupRole, that have no base class.)

I have been looking at the AST code (GormEntityTransformation and AstUtils) to understand the eligibility criteria for configuring domain classes as entities and also to see if any relevant logs or compiler warnings are generated in the process that I could get sight of.

To be honest I am on the cusp of abandoning my Grails 3 branch until at least #620 and this issue #581 are resolved as I cannot migrate the app. These issues are blockers for me. From a business perspective I haven't progressed my project in over 6 weeks while attempting to upgrade. 90% of this time has been spent debugging after my application of typical design patterns for a non-trivial app, this is quite similar actually to my initial entry experience to Grails 2.1, which was some time ago. I think I have to return to Grails 2.4 for now.

I am very fond of Grails but I seem to be one of those developers that pushes the boundaries of what it can do a bit and gets burnt. I have spent many hours dealing with unexpected limitations and issues during my Grails journey instead of writing business logic which has diminished the promise of RAD that drew me to the Grails world in the first place. Still, I accept this is an evolving and complex framework that can't do everything and it needs support from users pushing the boundaries in order to get there. I am looking forward to having a working app in the Grails 3 landscape once I finally get my apps migrated.

There are many good things about Grails 3 and I still believe that Groovy and Grails are the language and framework for most of my projects. I am an advocate. (I attended the Devoxx 2015 conference in London and a respected developer who was delivering a talk on languages after solving a programming problem in many different languages, concluded that we should all be developing in Groovy, which I found very pleasing and is completely aligned with my view.)

For a test scenario simply take the test app I uploaded on #620 and declare a field UUID id on the abstract base class. This will reproduce this OP's issue.

@LaboratoryGA

This comment has been minimized.

Show comment
Hide comment
@LaboratoryGA

LaboratoryGA Feb 9, 2016

I was able to duplicate this error another way - I had a domain class "ImageLayer" and a child class named "RasterImageLayer". I wanted the latter to perform some additional task when a property was set (field "contents"), so I coded the method "setContents()" ... this broke Grails and caused the OP's error.

Resolving this issue did not simply entail fixing the class in question - I actually had to clean and re-build the entire project.

I imagine by "setContents" method somehow caused the entire domain class mechanism to fail right from the start, since NONE of the tables were created.

LaboratoryGA commented Feb 9, 2016

I was able to duplicate this error another way - I had a domain class "ImageLayer" and a child class named "RasterImageLayer". I wanted the latter to perform some additional task when a property was set (field "contents"), so I coded the method "setContents()" ... this broke Grails and caused the OP's error.

Resolving this issue did not simply entail fixing the class in question - I actually had to clean and re-build the entire project.

I imagine by "setContents" method somehow caused the entire domain class mechanism to fail right from the start, since NONE of the tables were created.

@graemerocher graemerocher added this to the 5.0.2 milestone Feb 11, 2016

@graemerocher

This comment has been minimized.

Show comment
Hide comment
@graemerocher

graemerocher Feb 11, 2016

Member

Will look at this for GORM 5.0.2

Member

graemerocher commented Feb 11, 2016

Will look at this for GORM 5.0.2

@bond-

This comment has been minimized.

Show comment
Hide comment
@bond-

bond- Feb 11, 2016

Contributor

@LaboratoryGA Couldn't you do something like beforeinsert/afterinsert https://grails.github.io/grails-doc/latest/guide/GORM.html#eventsAutoTimestamping

Looks like you've overridden the GORM injected setter.

Contributor

bond- commented Feb 11, 2016

@LaboratoryGA Couldn't you do something like beforeinsert/afterinsert https://grails.github.io/grails-doc/latest/guide/GORM.html#eventsAutoTimestamping

Looks like you've overridden the GORM injected setter.

@LaboratoryGA

This comment has been minimized.

Show comment
Hide comment
@LaboratoryGA

LaboratoryGA Feb 11, 2016

I was trying to do exactly that, because I needed something to happen at
the exact point that one column was overridden, not at the events get
fired. Specifically, I needed to keep track of IF a particular field was
updated.
On Feb 11, 2016 00:37, "Ravi Teja" notifications@github.com wrote:

@LaboratoryGA https://github.com/LaboratoryGA Couldn't you do something
like aftreinsert
https://grails.github.io/grails-doc/latest/guide/GORM.html#eventsAutoTimestamping

Looks like you've overridden the GORM injected setter.


Reply to this email directly or view it on GitHub
#581 (comment)
.

LaboratoryGA commented Feb 11, 2016

I was trying to do exactly that, because I needed something to happen at
the exact point that one column was overridden, not at the events get
fired. Specifically, I needed to keep track of IF a particular field was
updated.
On Feb 11, 2016 00:37, "Ravi Teja" notifications@github.com wrote:

@LaboratoryGA https://github.com/LaboratoryGA Couldn't you do something
like aftreinsert
https://grails.github.io/grails-doc/latest/guide/GORM.html#eventsAutoTimestamping

Looks like you've overridden the GORM injected setter.


Reply to this email directly or view it on GitHub
#581 (comment)
.

@bond-

This comment has been minimized.

Show comment
Hide comment
@bond-

bond- Feb 11, 2016

Contributor

You've got beforeupdate for that. That might solve the purpose.
On 11 Feb 2016 21:34, "LaboratoryGA" notifications@github.com wrote:

I was trying to do exactly that, because I needed something to happen at
the exact point that one column was overridden, not at the events get
fired. Specifically, I needed to keep track of IF a particular field was
updated.
On Feb 11, 2016 00:37, "Ravi Teja" notifications@github.com wrote:

@LaboratoryGA https://github.com/LaboratoryGA Couldn't you do
something
like aftreinsert

https://grails.github.io/grails-doc/latest/guide/GORM.html#eventsAutoTimestamping

Looks like you've overridden the GORM injected setter.


Reply to this email directly or view it on GitHub
<
#581 (comment)

.


Reply to this email directly or view it on GitHub
#581 (comment)
.

Contributor

bond- commented Feb 11, 2016

You've got beforeupdate for that. That might solve the purpose.
On 11 Feb 2016 21:34, "LaboratoryGA" notifications@github.com wrote:

I was trying to do exactly that, because I needed something to happen at
the exact point that one column was overridden, not at the events get
fired. Specifically, I needed to keep track of IF a particular field was
updated.
On Feb 11, 2016 00:37, "Ravi Teja" notifications@github.com wrote:

@LaboratoryGA https://github.com/LaboratoryGA Couldn't you do
something
like aftreinsert

https://grails.github.io/grails-doc/latest/guide/GORM.html#eventsAutoTimestamping

Looks like you've overridden the GORM injected setter.


Reply to this email directly or view it on GitHub
<
#581 (comment)

.


Reply to this email directly or view it on GitHub
#581 (comment)
.

@LaboratoryGA

This comment has been minimized.

Show comment
Hide comment
@LaboratoryGA

LaboratoryGA Feb 11, 2016

I just discovered "isDirty" ... Sorry I didn't realise that method existed,
and that combines with onupdate is what I was after.
On Feb 11, 2016 8:19 AM, "Ravi Teja" notifications@github.com wrote:

You've got beforeupdate for that. That might solve the purpose.
On 11 Feb 2016 21:34, "LaboratoryGA" notifications@github.com wrote:

I was trying to do exactly that, because I needed something to happen at
the exact point that one column was overridden, not at the events get
fired. Specifically, I needed to keep track of IF a particular field was
updated.
On Feb 11, 2016 00:37, "Ravi Teja" notifications@github.com wrote:

@LaboratoryGA https://github.com/LaboratoryGA Couldn't you do
something
like aftreinsert

https://grails.github.io/grails-doc/latest/guide/GORM.html#eventsAutoTimestamping

Looks like you've overridden the GORM injected setter.


Reply to this email directly or view it on GitHub
<

#581 (comment)

.


Reply to this email directly or view it on GitHub
<
#581 (comment)

.


Reply to this email directly or view it on GitHub
#581 (comment)
.

LaboratoryGA commented Feb 11, 2016

I just discovered "isDirty" ... Sorry I didn't realise that method existed,
and that combines with onupdate is what I was after.
On Feb 11, 2016 8:19 AM, "Ravi Teja" notifications@github.com wrote:

You've got beforeupdate for that. That might solve the purpose.
On 11 Feb 2016 21:34, "LaboratoryGA" notifications@github.com wrote:

I was trying to do exactly that, because I needed something to happen at
the exact point that one column was overridden, not at the events get
fired. Specifically, I needed to keep track of IF a particular field was
updated.
On Feb 11, 2016 00:37, "Ravi Teja" notifications@github.com wrote:

@LaboratoryGA https://github.com/LaboratoryGA Couldn't you do
something
like aftreinsert

https://grails.github.io/grails-doc/latest/guide/GORM.html#eventsAutoTimestamping

Looks like you've overridden the GORM injected setter.


Reply to this email directly or view it on GitHub
<

#581 (comment)

.


Reply to this email directly or view it on GitHub
<
#581 (comment)

.


Reply to this email directly or view it on GitHub
#581 (comment)
.

@IgniteCoders

This comment has been minimized.

Show comment
Hide comment
@IgniteCoders

IgniteCoders Oct 4, 2017

Rebuild the project works for me

IgniteCoders commented Oct 4, 2017

Rebuild the project works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment