Использование gorm 6.1.2 с Grails 2.5.6
Я пытался использовать Gorm 6.1.2 с Grails 2.5.6, и я не смог запустить свое приложение. Пробовал добавлять или удалять плагины и даже пытался понять исключение, но ничего не имеет смысла. Я прилагаю свой buildConfig.groovy в надежде, что если кто-то столкнется с такой проблемой, это поможет мне исправить ошибки или направить меня в нужном направлении.
import grails.util.Environment
grails.servlet.version = "3.0" // Change depending on target container compliance (2.5 or 3.0)
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.work.dir = "target/work"
grails.project.target.level = 1.6
grails.project.source.level = 1.6
grails.reload.enabled = true
//grails.project.war.file = "target/${appName}-${appVersion}.war"
codenarc.ruleSetFiles = ["rulesets/basic.xml",
"rulesets/exceptions.xml",
"rulesets/imports.xml",
"rulesets/grails.xml",
"rulesets/unused.xml",
"rulesets/security.xml",
"rulesets/serialization.xml",
"rulesets/dry.xml",
"rulesets/convention.xml",
"rulesets/logging.xml",
"rulesets/unnecessary.xml",
"rulesets/formatting.xml",
"rulesets/concurrency.xml",
"rulesets/size.xml",
"rulesets/braces.xml",
"rulesets/design.xml",
"rulesets/formatting.xml",
"rulesets/groovyism.xml",
"rulesets/naming.xml",
"rulesets/unused.xml"]
grails.project.fork = [
test: [maxMemory: 2048, minMemory: 1024, debug: false, maxPerm: 256, daemon:true], // configure settings for the test-app JVM
run: [maxMemory: 2048, minMemory: 1024, debug: false, maxPerm: 256], // configure settings for the run-app JVM
war: [maxMemory: 2048, minMemory: 1024, debug: false, maxPerm: 256], // configure settings for the run-war JVM
console: [maxMemory: 2048, minMemory: 1024, debug: false, maxPerm: 256]// configure settings for the Console UI JVM
]
grails.project.dependency.resolver = "maven" // or ivy
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
excludes 'grails-datastore-simple'
}
log "info" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
checksums true // Whether to verify checksums on resolve
legacyResolve false
// whether to do a secondary resolve on plugin installation, not advised and here for backwards compatibility
repositories {
inherits true // Whether to inherit repository definitions from plugins
grailsPlugins() {
setUpdatePolicy("interval:1")
}
grailsHome()
mavenLocal() {
setUpdatePolicy("interval:1")
}
grailsCentral()
mavenCentral()
}
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.
test "org.grails:grails-datastore-test-support:1.0.2-grails-2.4"
test "org.spockframework:spock-grails-support:0.7-groovy-2.0"
compile 'org.springframework:spring-beans:4.1.9.RELEASE'
compile 'org.apache.httpcomponents:httpclient:4.3.6'
compile 'org.imgscalr:imgscalr-lib:4.2'
compile 'log4j:apache-log4j-extras:1.2.17'
compile 'com.tokbox:opentok-server-sdk:3.0.0-beta.1'
compile 'io.jsonwebtoken:jjwt:0.7.0'
compile "org.mongodb:mongo-java-driver:3.8.2"
}
plugins {
// plugins for the build system only
build "org.grails.plugins:codenarc:1.1"
// plugins for the build system only
build ":tomcat:7.0.70" // or ":tomcat:8.0.22"
// plugins for the compile step
compile ":scaffolding:2.1.2"
compile ':cache:1.1.8'
// asset-pipeline 2.0+ requires Java 7, use version 1.9.x with Java 6
compile ":asset-pipeline:2.5.7"
compile (":mongodb:6.1.2") {
exclude "mongo-java-driver"
}
compile ":spring-security-core:2.0-RC5"
compile ":spring-security-rest:1.5.0.RC4", {
excludes: 'spring-security-core'
}
compile "org.grails.plugins:rest-client-builder:2.1.1"
// plugins needed at runtime but not for compilation
runtime ":jquery:1.11.1"
runtime ":database-migration:1.4.0"
// plugins needed at runtime but not for compilation
runtime ":cors:1.1.6"
compile ":console:1.5.12"
compile ":wkhtmltopdf:0.1.10"
//runtime ":hibernate4:4.3.10"
compile ":oauth:2.6.1"
compile ":csv:0.3.1"
test(":spock:0.7") {
exclude "spock-grails-support"
}
/* Swagger plugin for API documentation */
compile ":swaggydoc:0.20"
compile (":hibernate4:6.1.2") {
excludes 'grails-datastore-simple'
}
}
}
Следующее исключение, которое я получаю -
2018-11-08 18:19:06,033[localhost-startStop-1][WARN ][groovy.grails.commons.spring.GrailsWebApplicationContext]- Exception encountered during context initialization - cancelling refresh attempt: 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 'mongoTransactionManager' while setting constructor argument with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoDatastore': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.grails.datastore.mapping.mongo.MongoDatastore]: Constructor threw exception; nested exception is groovy.lang.MissingPropertyException: No such property: property for class: org.grails.datastore.mapping.config.Entity
2018-11-08 18:19:06,113[localhost-startStop-1][ERROR][groovy.grails.web.context.GrailsContextLoaderListener]- Error initializing the application: 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 'mongoTransactionManager' while setting constructor argument with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoDatastore': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.grails.datastore.mapping.mongo.MongoDatastore]: Constructor threw exception; nested exception is groovy.lang.MissingPropertyException: No such property: property for class: org.grails.datastore.mapping.config.Entity
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 'mongoTransactionManager' while setting constructor argument with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoDatastore': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.grails.datastore.mapping.mongo.MongoDatastore]: Constructor threw exception; nested exception is groovy.lang.MissingPropertyException: No such property: property for class: org.grails.datastore.mapping.config.Entity
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'mongoTransactionManager' while setting constructor argument with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoDatastore': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.grails.datastore.mapping.mongo.MongoDatastore]: Constructor threw exception; nested exception is groovy.lang.MissingPropertyException: No such property: property for class: org.grails.datastore.mapping.config.Entity
... 4 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoDatastore': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.grails.datastore.mapping.mongo.MongoDatastore]: Constructor threw exception; nested exception is groovy.lang.MissingPropertyException: No such property: property for class: org.grails.datastore.mapping.config.Entity
... 4 more
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.grails.datastore.mapping.mongo.MongoDatastore]: Constructor threw exception; nested exception is groovy.lang.MissingPropertyException: No such property: property for class: org.grails.datastore.mapping.config.Entity
... 4 more
Caused by: groovy.lang.MissingPropertyException: No such property: property for class: org.grails.datastore.mapping.config.Entity
at org.grails.datastore.mapping.config.Entity.propertyMissing(Entity.groovy:295)
at org.grails.datastore.mapping.config.groovy.DefaultMappingConfigurationBuilder.invokeMethod(DefaultMappingConfigurationBuilder.groovy:64)
at com.mphrx.embeddedType.Filter$__clinit__closure1.doCall(Filter.groovy:16)
at org.grails.datastore.mapping.config.groovy.DefaultMappingConfigurationBuilder.evaluate(DefaultMappingConfigurationBuilder.groovy:98)
at org.grails.datastore.mapping.config.AbstractGormMappingFactory.evaluateWithContext(AbstractGormMappingFactory.java:110)
at org.grails.datastore.mapping.config.AbstractGormMappingFactory.createMappedForm(AbstractGormMappingFactory.java:95)
at org.grails.datastore.mapping.mongo.config.MongoMappingContext$DocumentEmbeddedPersistentEntity$DocumentCollectionMapping.<init>(MongoMappingContext.java:387)
at org.grails.datastore.mapping.mongo.config.MongoMappingContext$DocumentEmbeddedPersistentEntity.<init>(MongoMappingContext.java:375)
at org.grails.datastore.mapping.mongo.config.MongoMappingContext.createEmbeddedEntity(MongoMappingContext.java:367)
at org.grails.datastore.mapping.model.config.GormMappingConfigurationStrategy.getOrCreateEmbeddedEntity(GormMappingConfigurationStrategy.java:761)
at org.grails.datastore.mapping.model.config.GormMappingConfigurationStrategy.establishRelationshipForCollection(GormMappingConfigurationStrategy.java:328)
at org.grails.datastore.mapping.model.config.GormMappingConfigurationStrategy.getPersistentProperties(GormMappingConfigurationStrategy.java:191)
at org.grails.datastore.mapping.model.config.JpaMappingConfigurationStrategy.getPersistentProperties(JpaMappingConfigurationStrategy.java:35)
at org.grails.datastore.mapping.model.AbstractPersistentEntity.initialize(AbstractPersistentEntity.java:136)
at org.grails.datastore.mapping.model.EmbeddedPersistentEntity.initialize(EmbeddedPersistentEntity.java:38)
at org.grails.datastore.mapping.model.config.GormMappingConfigurationStrategy.getOrCreateEmbeddedEntity(GormMappingConfigurationStrategy.java:762)
at org.grails.datastore.mapping.model.config.GormMappingConfigurationStrategy.establishRelationshipForCollection(GormMappingConfigurationStrategy.java:328)
at org.grails.datastore.mapping.model.config.GormMappingConfigurationStrategy.getPersistentProperties(GormMappingConfigurationStrategy.java:191)
at org.grails.datastore.mapping.model.config.JpaMappingConfigurationStrategy.getPersistentProperties(JpaMappingConfigurationStrategy.java:35)
at org.grails.datastore.mapping.model.AbstractPersistentEntity.initialize(AbstractPersistentEntity.java:136)
at org.grails.datastore.mapping.model.config.GormMappingConfigurationStrategy.getOrCreateAssociatedEntity(GormMappingConfigurationStrategy.java:731)
at org.grails.datastore.mapping.model.config.GormMappingConfigurationStrategy.establishDomainClassRelationship(GormMappingConfigurationStrategy.java:689)
at org.grails.datastore.mapping.model.config.GormMappingConfigurationStrategy.getPersistentProperties(GormMappingConfigurationStrategy.java:197)
at org.grails.datastore.mapping.model.config.JpaMappingConfigurationStrategy.getPersistentProperties(JpaMappingConfigurationStrategy.java:35)
at org.grails.datastore.mapping.model.AbstractPersistentEntity.initialize(AbstractPersistentEntity.java:136)
at org.grails.datastore.mapping.model.config.GormMappingConfigurationStrategy.getOrCreateAssociatedEntity(GormMappingConfigurationStrategy.java:731)
at org.grails.datastore.mapping.model.config.GormMappingConfigurationStrategy.establishDomainClassRelationship(GormMappingConfigurationStrategy.java:689)
at org.grails.datastore.mapping.model.config.GormMappingConfigurationStrategy.getPersistentProperties(GormMappingConfigurationStrategy.java:197)
at org.grails.datastore.mapping.model.config.JpaMappingConfigurationStrategy.getPersistentProperties(JpaMappingConfigurationStrategy.java:35)
at org.grails.datastore.mapping.model.AbstractPersistentEntity.initialize(AbstractPersistentEntity.java:136)
at org.grails.datastore.mapping.model.AbstractMappingContext.initializePersistentEntity(AbstractMappingContext.java:351)
at org.grails.datastore.mapping.model.AbstractMappingContext.addPersistentEntities(AbstractMappingContext.java:280)
at org.grails.datastore.mapping.mongo.config.MongoMappingContext.initialize(MongoMappingContext.java:248)
at org.grails.datastore.mapping.mongo.config.MongoMappingContext.<init>(MongoMappingContext.java:139)
at org.grails.datastore.mapping.mongo.MongoDatastore.createMappingContext(MongoDatastore.java:938)
at org.grails.datastore.mapping.mongo.MongoDatastore.<init>(MongoDatastore.java:245)
at org.grails.datastore.mapping.mongo.MongoDatastore.<init>(MongoDatastore.java:357)
... 4 more
Error |
Forked Grails VM exited with error