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

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

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&gt;jhipster info
             INFO! Using JHipster version installed locally in current project&#39;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**


       &lt;details&gt;
       &lt;summary&gt;.yo-rc.json file&lt;/summary&gt;
       &lt;pre&gt;
        {
         &quot;generator-jhipster&quot;: {
            &quot;databaseType&quot;: &quot;sql&quot;,
            &quot;devDatabaseType&quot;: &quot;h2Disk&quot;,
            &quot;enableHibernateCache&quot;: true,
            &quot;enableSwaggerCodegen&quot;: false,
            &quot;enableTranslation&quot;: true,
            &quot;jhiPrefix&quot;: &quot;jhi&quot;,
            &quot;languages&quot;: [&quot;en&quot;, &quot;fr&quot;],
            &quot;messageBroker&quot;: false,
            &quot;nativeLanguage&quot;: &quot;en&quot;,
            &quot;packageName&quot;: &quot;com.mycompany.myapp&quot;,
            &quot;packageFolder&quot;: &quot;com/mycompany/myapp&quot;,
            &quot;prodDatabaseType&quot;: &quot;mysql&quot;,
            &quot;searchEngine&quot;: false,
            &quot;serviceDiscoveryType&quot;: false,
            &quot;skipClient&quot;: false,
           &quot;skipServer&quot;: false,
            &quot;testFrameworks&quot;: [&quot;protractor&quot;],
            &quot;websocket&quot;: false,
            &quot;baseName&quot;: &quot;oauth2&quot;,
           &quot;authenticationType&quot;: &quot;oauth2&quot;,
           &quot;buildTool&quot;: &quot;gradle&quot;,
           &quot;jhipsterVersion&quot;: &quot;6.4.1&quot;,
            &quot;skipUserManagement&quot;: true,
           &quot;clientPackageManager&quot;: &quot;npm&quot;,
           &quot;applicationType&quot;: &quot;monolith&quot;,
           &quot;cacheProvider&quot;: &quot;ehcache&quot;,
           &quot;clientFramework&quot;: &quot;angularX&quot;,
           &quot;clientTheme&quot;: &quot;none&quot;,
           &quot;clientThemeVariant&quot;: &quot;&quot;,
           &quot;serverPort&quot;: &quot;8080&quot;,
           &quot;useSass&quot;: true,
           &quot;embeddableLaunchScript&quot;: false,
            &quot;entitySuffix&quot;: &quot;&quot;,
            &quot;dtoSuffix&quot;: &quot;DTO&quot;,
            &quot;otherModules&quot;: [],
            &quot;blueprints&quot;: []
                                },
              &quot;entities&quot;: []
                                 }

              &lt;/pre&gt;
           &lt;/details&gt;


           ##### **JDL for the Entity configuration(s) `entityName.json` files generated in the        `.jhipster` directory**

           &lt;details&gt;
          &lt;summary&gt;JDL entity definitions&lt;/summary&gt;

           &lt;pre&gt;
           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

              &lt;/pre&gt;
             &lt;/details&gt;
              

             ##### **Environment and Tools**

            openjdk version &quot;11.0.8&quot; 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&gt;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.

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:

确定