出现了未满足的依赖异常:org.springframework.beans.factory。

huangapple go评论100阅读模式
英文:

issue with unsatisfiedDependencyException org.springframework.beans.factory

问题

以下是翻译好的部分:

  1. Microsoft Windows [版本 10.0.18362.1016]
  2. (c) 2019 Microsoft Corporation。保留所有权利。
  3. G:\mymobile\app> jhipster info
  4. INFO! 使用当前项目的 node_modules 中安装的 JHipster 版本
  5. INFO! 执行 jhipster:info
  6. INFO! 选项: from-cli: true
  7. 欢迎使用 JHipster 信息子生成器
  8. ##### **JHipster 版本**

oauth-2@0.0.1-SNAPSHOT G:\mymobile\app
`-- generator-jhipster@6.4.1

  1. ##### **JHipster 配置,`.yo-rc.json` 文件生成在根文件夹中**
  2. <details>
  3. <summary>.yo-rc.json 文件</summary>
  4. <pre>
  5. {
  6. "generator-jhipster": {
  7. "databaseType": "sql",
  8. "devDatabaseType": "h2Disk",
  9. "enableHibernateCache": true,
  10. "enableSwaggerCodegen": false,
  11. "enableTranslation": true,
  12. ...
  13. },
  14. "entities": []
  15. }
  16. </pre>
  17. </details>
  18. ##### **实体配置的 JDL,生成在 `.jhipster` 目录中的 `entityName.json` 文件**
  19. <details>
  20. <summary>JDL 实体定义</summary>
  21. <pre>
  22. entity Album {
  23. title String required,
  24. description TextBlob,
  25. created Instant
  26. }
  27. entity Photo {
  28. title String required,
  29. description TextBlob,
  30. image ImageBlob required,
  31. taken Instant
  32. }
  33. entity Tag {
  34. name String required minlength(2)
  35. }
  36. relationship ManyToOne {
  37. Album{user(login)} to User,
  38. Photo{album(title)} to Album
  39. }
  40. relationship ManyToMany {
  41. Photo{tag(name)} to Tag{photo}
  42. }
  43. paginate Album with pagination
  44. paginate Photo, Tag with infinite-scroll
  45. </pre>
  46. </details>
  47. ##### **环境和工具**
  48. openjdk 版本 "11.0.8" 2020-07-14
  49. OpenJDK 运行时环境 AdoptOpenJDK(构建 11.0.8+10
  50. OpenJDK 64 位服务器 VM AdoptOpenJDK(构建 11.0.8+10,混合模式)
  51. node: v12.18.3
  52. npm: 6.14.6
  53. yeoman: 3.1.1
  54. Docker 版本 19.03.1,构建 74b1e89e8a
  55. docker-compose 版本 1.24.1,构建 4667896b
  56. INFO! 恭喜,JHipster 执行完成!
  57. G:\mymobile\app> docker-compose -f src/main/docker/keycloak.yml up -d
  58. docker_keycloak_1 已更新
  59. >--- 堆栈跟踪已开发 ------
  60. 在上下文初始化期间遇到异常 - 取消刷新尝试: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.

  1. G:\mymobile\app&gt;jhipster info
  2. INFO! Using JHipster version installed locally in current project&#39;s node_modules
  3. INFO! Executing jhipster:info
  4. INFO! Options: from-cli: true
  5. Welcome to the JHipster Information Sub-Generator
  6. ##### **JHipster Version(s)**
  1. oauth-2@0.0.1-SNAPSHOT G:\mymobile\app
  2. `-- generator-jhipster@6.4.1
  1. ##### **JHipster configuration, a `.yo-rc.json` file generated in the root folder**
  2. &lt;details&gt;
  3. &lt;summary&gt;.yo-rc.json file&lt;/summary&gt;
  4. &lt;pre&gt;
  5. {
  6. &quot;generator-jhipster&quot;: {
  7. &quot;databaseType&quot;: &quot;sql&quot;,
  8. &quot;devDatabaseType&quot;: &quot;h2Disk&quot;,
  9. &quot;enableHibernateCache&quot;: true,
  10. &quot;enableSwaggerCodegen&quot;: false,
  11. &quot;enableTranslation&quot;: true,
  12. &quot;jhiPrefix&quot;: &quot;jhi&quot;,
  13. &quot;languages&quot;: [&quot;en&quot;, &quot;fr&quot;],
  14. &quot;messageBroker&quot;: false,
  15. &quot;nativeLanguage&quot;: &quot;en&quot;,
  16. &quot;packageName&quot;: &quot;com.mycompany.myapp&quot;,
  17. &quot;packageFolder&quot;: &quot;com/mycompany/myapp&quot;,
  18. &quot;prodDatabaseType&quot;: &quot;mysql&quot;,
  19. &quot;searchEngine&quot;: false,
  20. &quot;serviceDiscoveryType&quot;: false,
  21. &quot;skipClient&quot;: false,
  22. &quot;skipServer&quot;: false,
  23. &quot;testFrameworks&quot;: [&quot;protractor&quot;],
  24. &quot;websocket&quot;: false,
  25. &quot;baseName&quot;: &quot;oauth2&quot;,
  26. &quot;authenticationType&quot;: &quot;oauth2&quot;,
  27. &quot;buildTool&quot;: &quot;gradle&quot;,
  28. &quot;jhipsterVersion&quot;: &quot;6.4.1&quot;,
  29. &quot;skipUserManagement&quot;: true,
  30. &quot;clientPackageManager&quot;: &quot;npm&quot;,
  31. &quot;applicationType&quot;: &quot;monolith&quot;,
  32. &quot;cacheProvider&quot;: &quot;ehcache&quot;,
  33. &quot;clientFramework&quot;: &quot;angularX&quot;,
  34. &quot;clientTheme&quot;: &quot;none&quot;,
  35. &quot;clientThemeVariant&quot;: &quot;&quot;,
  36. &quot;serverPort&quot;: &quot;8080&quot;,
  37. &quot;useSass&quot;: true,
  38. &quot;embeddableLaunchScript&quot;: false,
  39. &quot;entitySuffix&quot;: &quot;&quot;,
  40. &quot;dtoSuffix&quot;: &quot;DTO&quot;,
  41. &quot;otherModules&quot;: [],
  42. &quot;blueprints&quot;: []
  43. },
  44. &quot;entities&quot;: []
  45. }
  46. &lt;/pre&gt;
  47. &lt;/details&gt;
  48. ##### **JDL for the Entity configuration(s) `entityName.json` files generated in the `.jhipster` directory**
  49. &lt;details&gt;
  50. &lt;summary&gt;JDL entity definitions&lt;/summary&gt;
  51. &lt;pre&gt;
  52. entity Album {
  53. title String required,
  54. description TextBlob,
  55. created Instant
  56. }
  57. entity Photo {
  58. title String required,
  59. description TextBlob,
  60. image ImageBlob required,
  61. taken Instant
  62. }
  63. entity Tag {
  64. name String required minlength(2)
  65. }
  66. relationship ManyToOne {
  67. Album{user(login)} to User,
  68. Photo{album(title)} to Album
  69. }
  70. relationship ManyToMany {
  71. Photo{tag(name)} to Tag{photo}
  72. }
  73. paginate Album with pagination
  74. paginate Photo, Tag with infinite-scroll
  75. &lt;/pre&gt;
  76. &lt;/details&gt;
  77. ##### **Environment and Tools**
  78. openjdk version &quot;11.0.8&quot; 2020-07-14
  79. OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10)
  80. OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.8+10, mixed mode)
  81. node: v12.18.3
  82. npm: 6.14.6
  83. yeoman: 3.1.1
  84. Docker version 19.03.1, build 74b1e89e8a
  85. docker-compose version 1.24.1, build 4667896b
  86. INFO! Congratulations, JHipster execution is complete!
  87. G:\mymobile\app&gt;docker-compose -f src/main/docker/keycloak.yml up -d
  88. 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.

huangapple
  • 本文由 发表于 2020年8月21日 15:57:28
  • 转载请务必保留本文链接:https://go.coder-hub.com/63518828.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定