简体   繁体   中英

Getting Error MessageBodyWriter not found for media type=application/json

I am implementing small application for rest webservice and want to get response in json formate. But I am getting this error on my Eclipse console .

Please help me out.

org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor aroundWriteTo
SEVERE: MessageBodyWriter not found for media type=application/json, type=class book.Test, genericType=class book.Test.

在此处输入图片说明

在此处输入图片说明

web.xml File : 在此处输入图片说明

All Jar files :

在此处输入图片说明

I have added all dependencies jar but still i am getting the same error.

Thanks.

Looks like you're missing a dependency: you enabled the POJOMappingFeature in the settings so you need to include jersey-media-moxy or jersey-media-json-jackson in your dependencies. Since your beans have JAXB annotation I guess you'll want both XML and JSON serialization, so MOXy is your choice.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM