jwilleke
jwilleke

Reputation: 11026

MessageBodyReader not found for media type=text/plain

Using PING Federate 8.x UnboundID SCIM 2 Client SDK

When trying to retreive results I am receving the error:

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)

I am assunming this is because PING Federate returns: Content-Type: application/json and apparently UnboundID is expecting type=text/plain.

How can we configure the SCIM client to expect application/json?

When using: PING Federate 8.x UnboundID SCIM 1.1 Client SDK

Exception in thread "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)

Thanks -jim

Upvotes: 0

Views: 690

Answers (1)

Bertold Kolics
Bertold Kolics

Reputation: 900

Doug Bulkley sent you an answer to you on January 12 and I am posting his answer here:

I have attached the sample java program (available at https://gist.github.com/bertold/009a0f8555c11720756711e6b3a6a7a2) I wrote to do this, which is based on the GitHub example https://github.com/UnboundID/scim

The only jar files in my CLASSPATH when I execute this sample code are all the jar files contained in the lib/ directory of the downloaded SCIM 1.8.15 SDK.

Here is what I see returned when I execute the program:

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

Upvotes: 0

Related Questions