powered by Jive Software

Facing issue while creating user in openfire

openfire

#1

I am using rest-api-client to create users in openfire with below code.

 AuthenticationToken authenticationToken = new AuthenticationToken("admin", "password");
         RestApiClient restApiClient = new RestApiClient("http://192.168.20.97", 7070, authenticationToken);
         UserEntity userEntity = new UserEntity("dasddasd","dsadsadasd", "", "password");
         restApiClient.createUser(userEntity);

My pom also has resteasy-client dependency which is causing following exception
I need resteasy-client dependency for creating Keycloak users how this issue can be handled?

Exception in thread “main” javax.ws.rs.ProcessingException: RESTEASY004655: Unable to invoke request
at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.invoke(ApacheHttpClient4Engine.java:316)
at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:462)
at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:498)
at org.jboss.resteasy.client.jaxrs.internal.ClientInvocationBuilder.method(ClientInvocationBuilder.java:295)
at org.igniterealtime.restclient.RestClient.call(RestClient.java:145)
at org.igniterealtime.restclient.RestClient.post(RestClient.java:91)
at org.igniterealtime.restclient.RestApiClient.createUser(RestApiClient.java:92)
at app.Test.main(Test.java:20)
Caused by: javax.ws.rs.ProcessingException: RESTEASY003215: could not find writer for content-type application/xml type: org.igniterealtime.restclient.entity.UserEntity
at org.jboss.resteasy.core.interception.jaxrs.ClientWriterInterceptorContext.throwWriterNotFoundException(ClientWriterInterceptorContext.java:40)
at org.jboss.resteasy.core.interception.jaxrs.AbstractWriterInterceptorContext.getWriter(AbstractWriterInterceptorContext.java:146)
at org.jboss.resteasy.core.interception.jaxrs.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:121)
at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.writeRequestBody(ClientInvocation.java:390)
at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.writeRequestBodyToOutputStream(ApacheHttpClient4Engine.java:630)
at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.buildEntity(ApacheHttpClient4Engine.java:595)
at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.loadHttpMethod(ApacheHttpClient4Engine.java:483)
at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.invoke(ApacheHttpClient4Engine.java:305)
… 7 more


#2

I met the same prolem.:joy::innocent: