英文:
issue with unsatisfiedDependencyException org.springframework.beans.factory
问题
以下是翻译好的部分:
Microsoft Windows [版本 10.0.18362.1016]
(c) 2019 Microsoft Corporation。保留所有权利。
G:\mymobile\app> jhipster info
INFO! 使用当前项目的 node_modules 中安装的 JHipster 版本
INFO! 执行 jhipster:info
INFO! 选项: from-cli: true
欢迎使用 JHipster 信息子生成器
##### **JHipster 版本**
oauth-2@0.0.1-SNAPSHOT G:\mymobile\app
`-- generator-jhipster@6.4.1
##### **JHipster 配置,`.yo-rc.json` 文件生成在根文件夹中**
<details>
<summary>.yo-rc.json 文件</summary>
<pre>
{
"generator-jhipster": {
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"enableHibernateCache": true,
"enableSwaggerCodegen": false,
"enableTranslation": true,
...
},
"entities": []
}
</pre>
</details>
##### **实体配置的 JDL,生成在 `.jhipster` 目录中的 `entityName.json` 文件**
<details>
<summary>JDL 实体定义</summary>
<pre>
entity Album {
title String required,
description TextBlob,
created Instant
}
entity Photo {
title String required,
description TextBlob,
image ImageBlob required,
taken Instant
}
entity Tag {
name String required minlength(2)
}
relationship ManyToOne {
Album{user(login)} to User,
Photo{album(title)} to Album
}
relationship ManyToMany {
Photo{tag(name)} to Tag{photo}
}
paginate Album with pagination
paginate Photo, Tag with infinite-scroll
</pre>
</details>
##### **环境和工具**
openjdk 版本 "11.0.8" 2020-07-14
OpenJDK 运行时环境 AdoptOpenJDK(构建 11.0.8+10)
OpenJDK 64 位服务器 VM AdoptOpenJDK(构建 11.0.8+10,混合模式)
node: v12.18.3
npm: 6.14.6
yeoman: 3.1.1
Docker 版本 19.03.1,构建 74b1e89e8a
docker-compose 版本 1.24.1,构建 4667896b
INFO! 恭喜,JHipster 执行完成!
G:\mymobile\app> docker-compose -f src/main/docker/keycloak.yml up -d
docker_keycloak_1 已更新
>--- 堆栈跟踪已开发 ------
在上下文初始化期间遇到异常 - 取消刷新尝试:org.springframework.beans.factory.UnsatisfiedDependencyException:在文件 [G:\mymobile\app\build\classes\java\main\com\mycompany\myapp\config\SecurityConfiguration.class] 中定义的名为 'securityConfiguration' 的 bean 的创建错误:通过构造函数参数 3 表达的不满足依赖关系;嵌套异常是 org.springframework.beans.factory.UnsatisfiedDependencyException:通过构造函数参数 0 表达的不满足依赖关系;嵌套异常是 org.springframework.beans.factory.UnsatisfiedDependencyException:通过方法 'setConfigurers' 参数 0 表达的不满足依赖关系;嵌套异常是 org.springframework.beans.factory.UnsatisfiedDependencyException:通过方法 'setClientRegistrationRepository' 参数 0 表达的不满足依赖关系;嵌套异常是 org.springframework.beans.factory.BeanCreationException:在类路径资源 [org/springframework/boot/autoconfigure/security/oauth2/client/servlet/OAuth2ClientRegistrationRepositoryConfiguration.class] 中定义的名为 'clientRegistrationRepository' 的 bean 的创建错误:通过工厂方法实例化 [org.springframework.security.oauth2.client.registration.InMemoryClientRegistrationRepository] 失败:工厂方法 'clientRegistrationRepository' 抛出异常;嵌套异常是 java.lang.IllegalArgumentException:无法解析提供的发行人的 OpenID 配置为 "http://localhost:9080/auth/realms/jhipster"
英文:
Microsoft Windows [Version 10.0.18362.1016]
(c) 2019 Microsoft Corporation. All rights reserved.
G:\mymobile\app>jhipster info
INFO! Using JHipster version installed locally in current project's node_modules
INFO! Executing jhipster:info
INFO! Options: from-cli: true
Welcome to the JHipster Information Sub-Generator
##### **JHipster Version(s)**
oauth-2@0.0.1-SNAPSHOT G:\mymobile\app
`-- generator-jhipster@6.4.1
##### **JHipster configuration, a `.yo-rc.json` file generated in the root folder**
<details>
<summary>.yo-rc.json file</summary>
<pre>
{
"generator-jhipster": {
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"enableHibernateCache": true,
"enableSwaggerCodegen": false,
"enableTranslation": true,
"jhiPrefix": "jhi",
"languages": ["en", "fr"],
"messageBroker": false,
"nativeLanguage": "en",
"packageName": "com.mycompany.myapp",
"packageFolder": "com/mycompany/myapp",
"prodDatabaseType": "mysql",
"searchEngine": false,
"serviceDiscoveryType": false,
"skipClient": false,
"skipServer": false,
"testFrameworks": ["protractor"],
"websocket": false,
"baseName": "oauth2",
"authenticationType": "oauth2",
"buildTool": "gradle",
"jhipsterVersion": "6.4.1",
"skipUserManagement": true,
"clientPackageManager": "npm",
"applicationType": "monolith",
"cacheProvider": "ehcache",
"clientFramework": "angularX",
"clientTheme": "none",
"clientThemeVariant": "",
"serverPort": "8080",
"useSass": true,
"embeddableLaunchScript": false,
"entitySuffix": "",
"dtoSuffix": "DTO",
"otherModules": [],
"blueprints": []
},
"entities": []
}
</pre>
</details>
##### **JDL for the Entity configuration(s) `entityName.json` files generated in the `.jhipster` directory**
<details>
<summary>JDL entity definitions</summary>
<pre>
entity Album {
title String required,
description TextBlob,
created Instant
}
entity Photo {
title String required,
description TextBlob,
image ImageBlob required,
taken Instant
}
entity Tag {
name String required minlength(2)
}
relationship ManyToOne {
Album{user(login)} to User,
Photo{album(title)} to Album
}
relationship ManyToMany {
Photo{tag(name)} to Tag{photo}
}
paginate Album with pagination
paginate Photo, Tag with infinite-scroll
</pre>
</details>
##### **Environment and Tools**
openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.8+10, mixed mode)
node: v12.18.3
npm: 6.14.6
yeoman: 3.1.1
Docker version 19.03.1, build 74b1e89e8a
docker-compose version 1.24.1, build 4667896b
INFO! Congratulations, JHipster execution is complete!
G:\mymobile\app>docker-compose -f src/main/docker/keycloak.yml up -d
docker_keycloak_1 is up-to-date
>---stack trace developed ------
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securityConfiguration' defined in file [G:\mymobile\app\build\classes\java\main\com\mycompany\myapp\config\SecurityConfiguration.class]: Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.zalando.problem.spring.web.advice.security.SecurityProblemSupport': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$EnableWebMvcConfiguration': Unsatisfied dependency expressed through method 'setConfigurers' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.security.config.annotation.web.configuration.OAuth2ClientConfiguration$OAuth2ClientWebMvcSecurityConfiguration': Unsatisfied dependency expressed through method 'setClientRegistrationRepository' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clientRegistrationRepository' defined in class path resource [org/springframework/boot/autoconfigure/security/oauth2/client/servlet/OAuth2ClientRegistrationRepositoryConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.security.oauth2.client.registration.InMemoryClientRegistrationRepository]: Factory method 'clientRegistrationRepository' threw exception; nested exception is java.lang.IllegalArgumentException: Unable to resolve the OpenID Configuration with the provided Issuer of "http://localhost:9080/auth/realms/jhipster"
答案1
得分: 4
看起来你还没有启动Keycloak(jhipster带有现成的Keycloak配置)。应用程序尝试在localhost:9080
处访问Keycloak。
如果你已经安装了Docker和docker-compose,你可以使用提供的docker-compose配置,并通过docker-compose -f src/main/docker/keycloak.yml up
启动Keycloak。
如果你想手动启动它,你需要确保在你的Keycloak实例中设置了jhipster领域。
英文:
It looks like you have not started keycloak (jhipster brings ready to use keycloak config). The app tries to reach keycloak at localhost:9080
.
If you have docker and docker-compose installed you can use the provided docker-compose configuration and start keycloak via docker-compose -f src/main/docker/keycloak.yml up
If you want to start it manually you need to make sure to setup the jhipster realm in your keycloak instance.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论