title: Keycloak admin client - javax.ws.rs.ProcessingException: RESTEASY003215
body: <p>Im using the Keycloak admin client (version 4.5.0.Final) and am trying to do some simple queries such as looking up a user. The client code is running in a plugin module in another java server, not standalone.  The code looks like this:</p>
  
  <pre><code>    ...
      try {
          Keycloak kc = Keycloak.getInstance(URL, REALM, USER, PWD, CLIENT_ID);
  
          UserRepresentation kcuser = kc.realm(REALM).users().get(USER).toRepresentation();
  
          trace(String.format("Got user: %s",  kcuser.toString()));
      } catch (Exception e) {
          trace("Error authenticating: " + e);
      }
      ...
  </code></pre>
  
  <p>It creates the kc instance successfully, but barfs when trying to look up the user. 
  This is the error:</p>
  
  <pre><code>javax.ws.rs.ProcessingException: RESTEASY003215: could not find writer for content-type application/x-www-form-urlencoded type: javax.ws.rs.core.Form$1
  at org.jboss.resteasy.core.interception.ClientWriterInterceptorContext.throwWriterNotFoundException(ClientWriterInterceptorContext.java:40)
  at org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.getWriter(AbstractWriterInterceptorContext.java:146)
  at org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:121)
  at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.writeRequestBody(ClientInvocation.java:394)
  at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.writeRequestBodyToOutputStream(ApacheHttpClient4Engine.java:666)
  at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.buildEntity(ApacheHttpClient4Engine.java:631)
  at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.loadHttpMethod(ApacheHttpClient4Engine.java:509)
  at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.invoke(ApacheHttpClient4Engine.java:310)
  at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:439)
  at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientInvoker.invokeSync(ClientInvoker.java:148)
  at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientInvoker.invoke(ClientInvoker.java:112)
  at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientProxy.invoke(ClientProxy.java:76)
  at com.sun.proxy.$Proxy362.grantToken(Unknown Source)
  at org.keycloak.admin.client.token.TokenManager.grantToken(TokenManager.java:89)
  at org.keycloak.admin.client.token.TokenManager.getAccessToken(TokenManager.java:69)
  at org.keycloak.admin.client.token.TokenManager.getAccessTokenString(TokenManager.java:64)
  at org.keycloak.admin.client.resource.BearerAuthFilter.filter(BearerAuthFilter.java:52)
  at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.filterRequest(ClientInvocation.java:587)
  at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:436)
  at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientInvoker.invokeSync(ClientInvoker.java:148)
  at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientInvoker.invoke(ClientInvoker.java:112)
  at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientProxy.invoke(ClientProxy.java:76)
  at com.sun.proxy.$Proxy372.toRepresentation(Unknown Source)
  ...
  </code></pre>
  
  <p>My pom has the latest dependencies and classpath seems ok, any ideas why this is not working?</p>
  
  <pre><code>&lt;properties&gt;
      &lt;keycloak.version&gt;4.5.0.Final&lt;/keycloak.version&gt;
      &lt;resteasy.version&gt;3.6.1.Final&lt;/resteasy.version&gt;
  
  &lt;/properties&gt;
  &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.keycloak&lt;/groupId&gt;
              &lt;artifactId&gt;keycloak-admin-client&lt;/artifactId&gt;
              &lt;version&gt;${keycloak.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
              &lt;artifactId&gt;resteasy-client&lt;/artifactId&gt;
              &lt;version&gt;${resteasy.version}&lt;/version&gt;
          &lt;/dependency&gt;       
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
              &lt;artifactId&gt;resteasy-multipart-provider&lt;/artifactId&gt;
              &lt;version&gt;${resteasy.version}&lt;/version&gt;
          &lt;/dependency&gt;                   
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
              &lt;artifactId&gt;resteasy-jackson2-provider&lt;/artifactId&gt;
              &lt;version&gt;${resteasy.version}&lt;/version&gt;
          &lt;/dependency&gt;                               
      &lt;/dependencies&gt;
  </code></pre>