gpt4 book ai didi

Keycloak 17 : Unsatisfied dependency for type org. keycloak.models.KeycloakSession 和限定符 [@Default]

转载 作者:行者123 更新时间:2023-12-05 05:45:11 30 4
gpt4 key购买 nike

我们使用 keycloak 作为 IDP 并有一些自定义插件/Spi,我们正在将我们的 keycloak 实例更新到版本 17 Quarkas 发行版,并且 SPI 在 keycloak 构建过程中开始中断(错误如下)。我已确保没有将 keycloak 库打包为 jar 的一部分。

SPI 如下所示,在 Manifest/services/org.keycloak.services.resource.RealmResourceProviderFactory 下的 Manifest 文件中有相应的条目

自定义 SPI/插件

public class SwaggerJsonRetrieverFactory implements RealmResourceProviderFactory {
@Override
public RealmResourceProvider create(KeycloakSession session) {
return new SwaggerJsonRetriever(session);
}


@Override
public void init(Config.Scope config) {

}


@Override
public void postInit(KeycloakSessionFactory factory) {

}


@Override
public void close() {

}

@Override
public String getId() {
return "swagger.json";
}
}

我的 pom.xml 如下所示

<dependencies>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-core</artifactId>
<scope>provided</scope>
<version>${keycloak.version}</version>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-server-spi</artifactId>
<version>${keycloak.version}</version>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-services</artifactId>
<scope>provided</scope>
<version>${keycloak.version}</version>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-server-spi-private</artifactId>
<scope>provided</scope>
<version>${keycloak.version}</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-parser</artifactId>
<version>1.0.22</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>${jackson-dataformat-yaml.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.ws.rs</groupId>
<artifactId>jboss-jaxrs-api_2.1_spec</artifactId>
<version>2.0.1.Final</version>
</dependency>

</dependencies>

我得到的错误

 io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step io.quarkus.arc.deployment.ArcProcessor#validate threw an exception: javax.enterprise.inject.spi.DeploymentException: Found 2 deployment problems:
[1] Unsatisfied dependency for type org.keycloak.models.KeycloakSession and qualifiers [@Default]
- java member: com.abc.swagger.SwaggerJsonRetriever().session
- declared on CLASS bean [types=[com.abc.swagger.SwaggerJsonRetriever, java.lang.Object], qualifiers=[@Default, @Any], target=com.abc.swagger.SwaggerJsonRetriever]
[2] Unsatisfied dependency for type org.keycloak.models.KeycloakSession and qualifiers [@Default]

是否有任何我遗漏的配置,我们将不胜感激。

最佳答案

从类中删除@Path 注解。

关于Keycloak 17 : Unsatisfied dependency for type org. keycloak.models.KeycloakSession 和限定符 [@Default],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71427463/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com