mysql - Grails 3 urlMappingsReport 失败

标签 mysql rest grails

我创建了一个 Grails 3 Restful 应用程序,使用 MySQL 作为数据库。当我使用像 Postman 这样的 Rest 客户端来访问端点时,端点工作正常。 我正在使用这个blog以供引用。但当我尝试运行命令 grails url-mappings-report 时,它失败了。

这是输出:

:compileJava NO-SOURCE
:compileGroovy
:buildProperties UP-TO-DATE
:processResources
:classes
:findMainClass
:urlMappingsReport

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


Configuring Spring Security REST 2.0.0.M2...
... finished configuring Spring Security REST

        ... with GORM support
2017-10-01 17:45:24.867 ERROR --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

The dependencies of some of the beans in the application context form a cycle:

   restTokenValidationFilter
      ↓
   restAuthenticationProvider
      ↓
   tokenStorageService
      ↓
   userDetailsService
┌─────┐
|  hibernateDatastore
↑     ↓
|  userPasswordEncoderListener
└─────┘


Context failed to load: Error creating bean with name 'restTokenValidationFilter': Cannot resolve reference to bean 'restAuthenticationProvider' while setting bean property 'restAuthenticationProvider'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'restAuthenticationProvider': Cannot resolve reference to bean 'tokenStorageService' while setting bean property 'tokenStorageService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tokenStorageService': Cannot resolve reference to bean 'userDetailsService' while setting bean property 'userDetailsService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDetailsService': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateDatastore': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.grails.orm.hibernate.HibernateDatastore]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userPasswordEncoderListener': Cannot resolve reference to bean 'hibernateDatastore' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'hibernateDatastore': Requested bean is currently in creation: Is there an unresolvable circular reference?
:urlMappingsReport FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':urlMappingsReport'.
> Process 'command '/usr/lib/jvm/java-8-openjdk-amd64/bin/java'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 37.453 secs
| Error Command [url-mappings-report] error: Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-3.4.1-bin.zip'. (Use --stacktrace to see the full trace)

Grails 版本:3.2.10

Groovy 版本:2.4.10

JVM 版本:1.8.0_131

最佳答案

尝试使用 GORM 版本 >= 6.1

我在 GORM 版本 6.0.12.RELEASE 中遇到了同样的问题

关于mysql - Grails 3 urlMappingsReport 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46512416/

相关文章:

mysql - 我如何将其从 TSQL 转换为 MYSQL?

sql - 在与 WHERE 共享的计算上优化 MySQL ORDER BY

java - Java 中的 REST 调用

Grails 3 - 在 Bootstrap.groovy 中读取类路径资源

php - JSON:从另一个域检索 JSON 文件

MySQL:获取上个月未审核的所有员工

java - 如何获取 json Web 服务请求的响应时间?

rest - 如何使用 Kafka REST 代理删除 Kafka 主题?

spring - 服务器在Grails中以302响应时如何获取响应正文?

unit-testing - Grails 2.2.1中模拟公式派生的字段