RESTEASY003145: Unable to find a MessageBodyReader of content-type application/json and type class org.keycloak.representations.AccessTokenResponse

前端 未结 6 1478
滥情空心
滥情空心 2020-12-20 12:45

I\'m trying to test Keycloak REST API. Instaled the version 2.1.0.Final. I can access the admin through browser with SSL without problems.

I\'m using the code above:

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-20 13:20

    On a wildfly 11 / Keycloak context, the following made it work with the RestEasyClientBuilder.

    ResteasyClientBuilder builder = new ResteasyClientBuilder();
    ResteasyProviderFactory providerFactory = ResteasyProviderFactory.getInstance();
    builder.providerFactory(providerFactory);
    

    Double check if ResteasyProviderFactory defaults to true with your Resteasy version. If not, set the builtIns manually:

    ResteasyProviderFactory.setRegisterBuiltinByDefault(true);
    // or if ResteasyProviderFactory was already instantiated
    RegisterBuiltin.register(providerFactory);
    

提交回复
热议问题