找不到媒体类型= text / plain的MessageBodyReader

时间:2016-12-12 13:39:21

标签: scim unboundid

使用 PING Federate 8.x UnboundID SCIM 2 Client SDK

尝试检索结果时,我收到错误:

com.unboundid.scim2.client.ScimServiceException: MessageBodyReader not found for media type=text/plain, type=class com.unboundid.scim2.common.messages.ErrorResponse, genericType=class com.unboundid.scim2.common.messages.ErrorResponse.
    at com.unboundid.scim2.client.requests.RequestBuilder.toScimException(RequestBuilder.java:136)
    at com.unboundid.scim2.client.requests.SearchRequestBuilder.invoke(SearchRequestBuilder.java:325)
    at com.unboundid.scim2.client.requests.SearchRequestBuilder.invoke(SearchRequestBuilder.java:152)
    at com.unboundid.scim2.client.ScimService.getResourceTypes(ScimService.java:113)
    at com.willeke.scim.Scim2Test01.main(Scim2Test01.java:100)

我猜这是因为PING Federate回归: Content-Type:application / json,显然UnboundID期望type = text / plain。

我们如何配置SCIM客户端以期待application / json?

使用时: PING Federate 8.x UnboundID SCIM 1.1 Client SDK

线程“main”中的异常java.lang.NoSuchMethodError:

javax.ws.rs.core.MultivaluedMap.addAll(Ljava/lang/Object;[Ljava/lang/Object;)V
    at org.glassfish.jersey.client.ClientRequest.accept(ClientRequest.java:326)
    at org.glassfish.jersey.client.JerseyInvocation$Builder.accept(JerseyInvocation.java:237)
    at org.glassfish.jersey.client.JerseyInvocation$Builder.accept(JerseyInvocation.java:154)
    at org.apache.wink.client.Resource.get(Resource.java:177)
    at com.unboundid.scim.sdk.SCIMEndpoint.query(SCIMEndpoint.java:347)
    at com.unboundid.scim.sdk.SCIMEndpoint.query(SCIMEndpoint.java:271)
    at com.unboundid.scim.sdk.SCIMEndpoint.query(SCIMEndpoint.java:249)
    at com.willeke.scim.Client.main(Client.java:38)

谢谢-jim

1 个答案:

答案 0 :(得分:0)

Doug Bulkley在1月12日给你一个答案,我在这里发表了他的答案:

我附上了我编写的示例java程序(可在https://gist.github.com/bertold/009a0f8555c11720756711e6b3a6a7a2获得),这是基于GitHub示例https://github.com/UnboundID/scim

执行此示例代码时,我的CLASSPATH中唯一的jar文件是下载的SCIM 1.8.15 SDK的lib /目录中包含的所有jar文件。

以下是我执行程序时看到的内容:

Name{formatted='null', familyName='0', middleName='null', givenName='user', honorificPrefix='null', honorificSuffix='null’}