0

I have created one RESTful unmanaged extension and deployed under plugin directory of Neo4j 3.1.2. My REST method is accepting custom POJO with POST method. Whenever I am trying to hit my extension, I get below response:

MIME media type application/json was not found. The registered message body readers compatible with the MIME media type are: com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$App com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$App com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$App com.sun.jersey.core.impl.provider.entity.FormProvider com.sun.jersey.core.impl.provider.entity.MimeMultipartProvider com.sun.jersey.core.impl.provider.entity.StringProvider com.sun.jersey.core.impl.provider.entity.ByteArrayProvider com.sun.jersey.core.impl.provider.entity.FileProvider com.sun.jersey.core.impl.provider.entity.InputStreamProvider com.sun.jersey.core.impl.provider.entity.DataSourceProvider com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General com.sun.jersey.core.impl.provider.entity.ReaderProvider com.sun.jersey.core.impl.provider.entity.DocumentProvider com.sun.jersey.core.impl.provider.entity.SourceProvider$StreamSourceReader com.sun.jersey.core.impl.provider.entity.SourceProvider$SAXSourceReader com.sun.jersey.core.impl.provider.entity.SourceProvider$DOMSourceReader com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$General com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General com.sun.jersey.core.impl.provider.entity.XMLRootObjectProvider$General com.sun.jersey.core.impl.provider.entity.EntityHolderReader com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$General com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$General com.sun.jersey.json.impl.provider.entity.JacksonProviderProxy

Bruno Peres
  • 15,845
  • 5
  • 53
  • 89
Amit G
  • 15
  • 5

1 Answers1

2

According this SO Answer you can fix this issue by adding jersey-json as a maven dependency.

That is: adding the below lines to your POM.xml file:

<dependency>
    <groupId>com.sun.jersey</groupId>
    <artifactId>jersey-json</artifactId>
    <version>1.19.4</version>
</dependency>
Bruno Peres
  • 15,845
  • 5
  • 53
  • 89
  • Thanks Bruno, its working now. I was missing @XmlRootElement annotation. – Amit G Oct 24 '17 at 17:48
  • Hi @AmitG You are welcome! Also, if this answer has solved your question please consider [accepting it](https://meta.stackexchange.com/a/5235/360570) by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself. There is no obligation to do this. Otherwise, if your own solution has solved the problem, I suggest to you answer your own question and accept your answer when possible. – Bruno Peres Oct 24 '17 at 17:51