в затмении я создал динамический веб-проект, а затем настроен на Maven. После этого я разработал базовый сервис отдыха: я добавил класс пользователя (имя, возраст), HTML-страницу и сервис отдыха. Кнопка, которая является html-страницей, нажимается ajax для отправки запроса на отдых сервиса. Служба отдыха возвращает имя пользователя и возраст в виде объекта json. но это работает на JSON. Я взял 500 ошибок, но если я выбрал текст или строку службы работают успешно. Я не могу решить это, пожалуйста, помогите мне свести меня с ума :)

Я проверяю все примеры на зависимости Google POM или веб-XML Conf. но это не работает

-- My user class package main.java.com.json; public class User { private String userName; private int userAge; public void setUserName(String userName) { this.userName = userName; } public String getUserName() { return userName; } public void setUserAge(int userAge) { this.userAge = userAge; } public int getUserAge() { return userAge; } } -- My rest service @Path("/RestApiService") public class RestApiService { @GET @Produces(MediaType.APPLICATION_JSON) @Path("/printFeedback/{var1}/") public User printFeedback(@PathParam("var1") String var1) { User user = new User(); user.setUserAge(28); user.setUserName("xxx yyy"); return user; } } -- my html {amp}lt;!DOCTYPE html{amp}gt; {amp}lt;html{amp}gt; {amp}lt;head{amp}gt; {amp}lt;meta charset="UTF-8"{amp}gt; {amp}lt;title{amp}gt;Insert title here{amp}lt;/title{amp}gt; {amp}lt;script type="text/javascript" src="theme/js/jquery.js"{amp}gt;{amp}lt;/script{amp}gt; {amp}lt;/head{amp}gt; {amp}lt;body{amp}gt; {amp}lt;input maxlength="6" name="usename" id="userId"{amp}gt; {amp}lt;button id="clickBtn"{amp}gt;Tıkla{amp}lt;/button{amp}gt; {amp}lt;/body{amp}gt; {amp}lt;script{amp}gt; $("#clickBtn").click(function () { var userId=$("#userId").val() ; alert("userId"  userId); $.ajax({ url: "./rest/RestApiService/printFeedback/" userId "/", type: "GET", dataType:"json", success: function(response) { alert("hello"); }, error: function() { alert("error"); } }); }); {amp}lt;/script{amp}gt; {amp}lt;/html{amp}gt; ---web.xml---- {amp}lt;?xml version="1.0" encoding="UTF-8"?{amp}gt; {amp}lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"{amp}gt; {amp}lt;display-name{amp}gt;RestApiExample{amp}lt;/display-name{amp}gt; {amp}lt;welcome-file-list{amp}gt; {amp}lt;welcome-file{amp}gt;index.html{amp}lt;/welcome-file{amp}gt; {amp}lt;welcome-file{amp}gt;index.htm{amp}lt;/welcome-file{amp}gt; {amp}lt;welcome-file{amp}gt;index.jsp{amp}lt;/welcome-file{amp}gt; {amp}lt;welcome-file{amp}gt;default.html{amp}lt;/welcome-file{amp}gt; {amp}lt;welcome-file{amp}gt;default.htm{amp}lt;/welcome-file{amp}gt; {amp}lt;welcome-file{amp}gt;default.jsp{amp}lt;/welcome-file{amp}gt; {amp}lt;/welcome-file-list{amp}gt; {amp}lt;servlet{amp}gt; {amp}lt;servlet-name{amp}gt;Jersey REST Service{amp}lt;/servlet-name{amp}gt; {amp}lt;servlet-class{amp}gt; org.glassfish.jersey.servlet.ServletContainer {amp}lt;/servlet-class{amp}gt; {amp}lt;init-param{amp}gt; {amp}lt;param-name{amp}gt;jersey.config.server.provider.packages{amp}lt;/param-name{amp}gt; {amp}lt;param-value{amp}gt;main.java.com.services{amp}lt;/param-value{amp}gt; {amp}lt;/init-param{amp}gt; {amp}lt;init-param{amp}gt; {amp}lt;param-name{amp}gt;com.sun.jersey.api.json.POJOMappingFeature{amp}lt;/param-name{amp}gt; {amp}lt;param-value{amp}gt;true{amp}lt;/param-value{amp}gt; {amp}lt;/init-param{amp}gt; {amp}lt;load-on-startup{amp}gt;1{amp}lt;/load-on-startup{amp}gt; {amp}lt;/servlet{amp}gt; {amp}lt;servlet-mapping{amp}gt; {amp}lt;servlet-name{amp}gt;Jersey REST Service{amp}lt;/servlet-name{amp}gt; {amp}lt;url-pattern{amp}gt;/rest/*{amp}lt;/url-pattern{amp}gt; {amp}lt;/servlet-mapping{amp}gt; {amp}lt;/web-app{amp}gt; -----pom.xml--- {amp}lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"{amp}gt; {amp}lt;modelVersion{amp}gt;4.0.0{amp}lt;/modelVersion{amp}gt; {amp}lt;groupId{amp}gt;RestApiExample{amp}lt;/groupId{amp}gt; {amp}lt;artifactId{amp}gt;RestApiExample{amp}lt;/artifactId{amp}gt; {amp}lt;version{amp}gt;0.0.1-SNAPSHOT{amp}lt;/version{amp}gt; {amp}lt;packaging{amp}gt;war{amp}lt;/packaging{amp}gt; {amp}lt;build{amp}gt; {amp}lt;sourceDirectory{amp}gt;src{amp}lt;/sourceDirectory{amp}gt; {amp}lt;plugins{amp}gt; {amp}lt;plugin{amp}gt; {amp}lt;artifactId{amp}gt;maven-compiler-plugin{amp}lt;/artifactId{amp}gt; {amp}lt;version{amp}gt;3.1{amp}lt;/version{amp}gt; {amp}lt;configuration{amp}gt; {amp}lt;source{amp}gt;1.8{amp}lt;/source{amp}gt; {amp}lt;target{amp}gt;1.8{amp}lt;/target{amp}gt; {amp}lt;/configuration{amp}gt; {amp}lt;/plugin{amp}gt; {amp}lt;plugin{amp}gt; {amp}lt;artifactId{amp}gt;maven-war-plugin{amp}lt;/artifactId{amp}gt; {amp}lt;version{amp}gt;2.4{amp}lt;/version{amp}gt; {amp}lt;configuration{amp}gt; {amp}lt;warSourceDirectory{amp}gt;WebContent{amp}lt;/warSourceDirectory{amp}gt; {amp}lt;failOnMissingWebXml{amp}gt;false{amp}lt;/failOnMissingWebXml{amp}gt; {amp}lt;/configuration{amp}gt; {amp}lt;/plugin{amp}gt; {amp}lt;/plugins{amp}gt; {amp}lt;/build{amp}gt; {amp}lt;dependencies{amp}gt; {amp}lt;dependency{amp}gt; {amp}lt;groupId{amp}gt;javax.ws.rs{amp}lt;/groupId{amp}gt; {amp}lt;artifactId{amp}gt;javax.ws.rs-api{amp}lt;/artifactId{amp}gt; {amp}lt;version{amp}gt;2.1{amp}lt;/version{amp}gt; {amp}lt;/dependency{amp}gt; {amp}lt;dependency{amp}gt; {amp}lt;groupId{amp}gt;org.glassfish.jersey.containers{amp}lt;/groupId{amp}gt; {amp}lt;artifactId{amp}gt;jersey-container-servlet{amp}lt;/artifactId{amp}gt; {amp}lt;version{amp}gt;2.26{amp}lt;/version{amp}gt; {amp}lt;/dependency{amp}gt; {amp}lt;dependency{amp}gt; {amp}lt;groupId{amp}gt;org.glassfish.jersey.core{amp}lt;/groupId{amp}gt; {amp}lt;artifactId{amp}gt;jersey-server{amp}lt;/artifactId{amp}gt; {amp}lt;version{amp}gt;2.26{amp}lt;/version{amp}gt; {amp}lt;/dependency{amp}gt; {amp}lt;dependency{amp}gt; {amp}lt;groupId{amp}gt;org.glassfish.jersey.inject{amp}lt;/groupId{amp}gt; {amp}lt;artifactId{amp}gt;jersey-hk2{amp}lt;/artifactId{amp}gt; {amp}lt;version{amp}gt;2.26{amp}lt;/version{amp}gt; {amp}lt;/dependency{amp}gt; {amp}lt;dependency{amp}gt; {amp}lt;groupId{amp}gt;org.json{amp}lt;/groupId{amp}gt; {amp}lt;artifactId{amp}gt;json{amp}lt;/artifactId{amp}gt; {amp}lt;version{amp}gt;20090211{amp}lt;/version{amp}gt; {amp}lt;/dependency{amp}gt; {amp}lt;dependency{amp}gt; {amp}lt;groupId{amp}gt;com.sun.jersey{amp}lt;/groupId{amp}gt; {amp}lt;artifactId{amp}gt;jersey-json{amp}lt;/artifactId{amp}gt; {amp}lt;version{amp}gt;1.6{amp}lt;/version{amp}gt; {amp}lt;/dependency{amp}gt; {amp}lt;/dependencies{amp}gt; {amp}lt;/project{amp}gt; 

Консольный журнал

Ошибка 500-интервального сервера в моей консоли: SEVERE: MessageBodyWriter не найден для типа носителя = application / json, type = class main.java.com.json.User, genericType = class main.java.com.json.User.