Keycloak-Admin-Client:java.lang.AbstractMethodError:javax.ws.rs.core.UriBuilder.uri(Ljava / lang / String;)Ljavax / ws / rs / core / UriBuilder;

时间:2019-06-25 20:50:59

标签: java jax-rs resteasy keycloak

在密钥库实例构建过程中出现以下错误

stacktrace

java.lang.AbstractMethodError: javax.ws.rs.core.UriBuilder.uri(Ljava/lang/String;)Ljavax/ws/rs/core/UriBuilder;
    at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:119)
    at org.jboss.resteasy.client.jaxrs.internal.ClientWebTarget.<init>(ClientWebTarget.java:38)
    at org.jboss.resteasy.client.jaxrs.ResteasyClient.target(ResteasyClient.java:175)
    at org.keycloak.admin.client.token.TokenManager.<init>(TokenManager.java:51)
    at org.keycloak.admin.client.Keycloak.<init>(Keycloak.java:59)
    at org.keycloak.admin.client.KeycloakBuilder.build(KeycloakBuilder.java:147)

POM.xml

    <properties>
    <keycloak.version>RELEASE</keycloak.version>
    <resteasy.version>3.0.0.Final</resteasy.version>
</properties>


<!--Keycloak Configuration -->
    <dependency>
        <groupId>org.keycloak</groupId>
        <artifactId>keycloak-core</artifactId>
        <version>${keycloak.version}</version>
    </dependency>
    <dependency>
        <groupId>org.keycloak</groupId>
        <artifactId>keycloak-common</artifactId>
        <version>${keycloak.version}</version>
    </dependency>

    <dependency>
        <groupId>org.keycloak</groupId>
        <artifactId>keycloak-admin-client</artifactId>
        <version>${keycloak.version}</version>
    </dependency>
    <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-client</artifactId>
        <version>${resteasy.version}</version>
        <exclusions>

            <exclusion>
                <groupId>org.jboss.resteasy</groupId>
                <artifactId>javax.ws.rs</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <!--<dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-jaxrs</artifactId>
        <version>${resteasy.version}</version>
    </dependency>-->
    <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-jackson2-provider</artifactId>
        <version>${resteasy.version}</version>


    </dependency>
    Keycloak kc = KeycloakBuilder.builder() //
                    .serverUrl("http://xyz:8080/auth") //
                    .realm("master")//
                    .username("admin") //
                    .password("password") //
                    .clientId("admin-cli") //
                    .resteasyClient(new ResteasyClientBuilder().connectionPoolSize(10).build()) //
                    .build();

        List<UserRepresentation> result = kc.realm("master").users().list();

0 个答案:

没有答案