Grails exception, possibly related to consequences, related to NoClassDefFoundError / BuildableCriteria

I am new to Grails. I never touched this until this week.

Grails version: 2.5.4
Java version "1.8.0_101" 

These crashes occur when I run unit tests with:

grails test-app

I have already changed a number of things, and the code appears to compile as is.

An example of a stack trace that I see:

| Failure:  testUpdate(com.xyz.pdq.WidgetControllerTests)
|  java.lang.NoClassDefFoundError: org/grails/datastore/mapping/query/api/BuildableCriteria
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
    at java.lang.Class.privateGetPublicMethods(Class.java:2902)
    at java.lang.Class.getMethods(Class.java:1615)
    at java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1336)
    at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1197)
    at java.beans.Introspector.getBeanInfo(Introspector.java:426)
    at java.beans.Introspector.getBeanInfo(Introspector.java:173)
    at grails.test.mixin.domain.TestGormEnhancer.getStaticApi(DomainClassUnitTestMixin.groovy:188)
    at org.grails.datastore.gorm.GormEnhancer.addStaticMethods(GormEnhancer.groovy:118)
    at org.grails.datastore.gorm.GormEnhancer.enhance(GormEnhancer.groovy:112)
    at org.grails.datastore.gorm.GormEnhancer.enhance(GormEnhancer.groovy:95)
    at grails.test.mixin.domain.DomainClassUnitTestMixin.mockDomains(DomainClassUnitTestMixin.groovy:99)
Caused by: java.lang.ClassNotFoundException: org.grails.datastore.mapping.query.api.BuildableCriteria
    at org.codehaus.groovy.tools.RootLoader.findClass(RootLoader.java:179)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:151)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 12 more

I work with the following:

plugins {
    runtime ":hibernate4:4.3.5.2"
    runtime ":jquery:1.11.1"
    runtime ":resources:1.2.14"
    build ":tomcat:7.0.52.1"
    runtime ":database-migration:1.4.1"
    compile ':cache:1.1.8'  
}

What methodology can I keep track of this, assuming it's a dependency?

The dependency report shows that I have this:

org.grails:grails-datastore-core:3.1.0.RELEASE

... as noted here in this excerpt from the dependency report:

...
+--- org.grails.plugins:hibernate4:4.3.5.2
|    \--- org.hibernate:hibernate-ehcache:4.3.5.Final
|         \--- org.jboss.logging:jboss-logging-annotations:1.2.0.Beta1
|         \--- org.hibernate:hibernate-core:4.3.5.Final
|              \--- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.0.0.Final
|              \--- antlr:antlr:2.7.7
|              \--- org.jboss:jandex:1.1.0.Final
|    \--- org.hibernate:hibernate-validator:5.0.3.Final
|         \--- com.fasterxml:classmate:1.0.0
|    \--- net.sf.ehcache:ehcache-core:2.4.8
|    \--- org.jboss.logging:jboss-logging:3.1.0.GA
|    \--- org.grails:grails-datastore-core:3.1.0.RELEASE
|         \--- javax.transaction:jta:1.1
|    \--- org.grails:grails-datastore-gorm:3.1.0.RELEASE
|    \--- org.grails:grails-datastore-gorm-hibernate4:3.1.0.RELEASE
|         \--- org.hibernate.common:hibernate-commons-annotations:4.0.4.Final
|         \--- org.grails:grails-datastore-gorm-hibernate-core:3.1.0.RELEASE
|              \--- org.grails:grails-datastore-gorm-plugin-support:3.1.0.RELEASE
|              \--- org.springframework:spring-orm:4.1.8.RELEASE
|         \--- dom4j:dom4j:1.6.1
|    \--- org.grails:grails-datastore-simple:3.1.0.RELEASE
...

This pattern is repeated both at run time and in test.

+4
source share
1 answer

Graeme Rocher. hibernate:

compile ":hibernate4:4.3.10"

0

Source: https://habr.com/ru/post/1656708/


All Articles