igniterealtime / REST-API-Client

Java REST API Client for the Openfire to manage Openfire instances by sending an REST/HTTP request to the server
Apache License 2.0
102 stars 62 forks source link

messageBodyProviderNotFoundException #11

Closed ozgurgundogan closed 8 years ago

ozgurgundogan commented 8 years ago

Although I used your project with maven, I am getting an exception beacuse of one of dependencies.

Exception : org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException: MessageBodyReader not found for media type=text/html;charset=UTF-8, type=class org.igniterealtime.restclient.entity.UserEntities, genericType=class org.igniterealtime.restclient.entity.UserEntities.

Stack Trace:

at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.aroundReadFrom(ReaderInterceptorExecutor.java:231) at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor.proceed(ReaderInterceptorExecutor.java:155) at org.glassfish.jersey.message.internal.MessageBodyFactory.readFrom(MessageBodyFactory.java:1085) at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:874) at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:808) at org.glassfish.jersey.client.ClientResponse.readEntity(ClientResponse.java:326) at org.glassfish.jersey.client.InboundJaxrsResponse$1.call(InboundJaxrsResponse.java:115) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.process(Errors.java:228) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:419) at org.glassfish.jersey.client.InboundJaxrsResponse.runInScopeIfPossible(InboundJaxrsResponse.java:267) at org.glassfish.jersey.client.InboundJaxrsResponse.readEntity(InboundJaxrsResponse.java:112) at org.igniterealtime.restclient.RestClient.call(RestClient.java:155) at org.igniterealtime.restclient.RestClient.get(RestClient.java:75) at org.igniterealtime.restclient.RestApiClient.getUsers(RestApiClient.java:56)

Redor commented 8 years ago

Did you tried over the maven (pom) ?

ozgurgundogan commented 8 years ago

Yes I tried. This exception is thrown from the version I tried over maven (pom).

pilisir commented 8 years ago

Same problem here, when I use the jar file from Gradle, everything is good, but I try to deploy it as source code from github, I got this exception.

Redor commented 8 years ago

@jasonjianfr it happens because of one dependency in the pom. Did you also copied all dependency to your pom?

pilisir commented 8 years ago

Great Thank! I miss one of dependency, jersey-media-jaxb. But I'm confused about that I make my dependency of Gradle as follow, it work fine. compile "org.glassfish.jersey.core:jersey-client:$jerseyVersion" compile "org.igniterealtime:rest-api-client:$igniterealtimeRESTapiclientVersion" In the other case, I deploy it as source code and make dependency of Gradle as follow, i got this issuse. compile "org.glassfish.jersey.core:jersey-client:$jerseyVersion" //compile "org.igniterealtime:rest-api-client:$igniterealtimeRESTapiclientVersion" Only if I add the jersey-media-jaxb. compile "org.glassfish.jersey.media:jersey-media-jaxb:$jerseyVersion" I have no idea why the jersey-media-jaxb is unnecessary in first situation.