title: Jersey 2.x does not support POJO to json?
body: <p>While i am trying to convert java object to json object by using jersey.i am having an exception.</p>
  
  <p>Java code :-(POJO)</p>
  
  <pre><code>  package org.jersey.media.type;
    import javax.xml.bind.annotation.XmlRootElement;
    @XmlRootElement
    public class MyJaxbBean {
    public String name;
    public int age;
  
    public MyJaxbBean() {} // JAXB needs this
  
    public MyJaxbBean(String name, int age) {
      this.name = name;
      this.age = age;
      }
   }
  </code></pre>
  
  <p>Resource :-</p>
  
  <pre><code>package org.jersey.media.type;
  import javax.ws.rs.GET;
  import javax.ws.rs.Path; 
  import javax.ws.rs.Produces;
  @Path("/media")
  public class MediaResources {
  @GET
  @Produces("application/xml")
  public MyJaxbBean getMyBean() {
      return new MyJaxbBean("Agamemnon", 32);
   }
  }
  </code></pre>
  
  <p>Exception:-</p>
  
  <pre><code>Sep 05, 2015 4:20:38 PM org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWr   iterInterceptor aroundWriteTo
      SEVERE: MessageBodyWriter not found for media type=application/json,            type=class org.jersey.media.type.MyJaxbBean, genericType=class     org.jersey.media.type.MyJaxbBean.
  </code></pre>
  
  <p>Deployment Descriptor:-</p>
  
  <pre><code>&lt;web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
  version="3.1"&gt;
  &lt;display-name&gt;JerseyAuthentication&lt;/display-name&gt;
  &lt;servlet&gt;
      &lt;servlet-name&gt;Application&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.glassfish.jersey.servlet.ServletContainer&lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;jersey.config.server.provider.packages&lt;/param-name&gt;
          &lt;param-value&gt;org.jersey.media.type&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;!-- &lt;init-param&gt;
          &lt;param-name&gt;jersey.config.server.provider.classnames&lt;/param-name&gt;
          &lt;param-value&gt;org.glassfish.jersey.jackson.JacksonFeature,org.glassfish.jersey.jackson.JacksonBinder&lt;/param-value&gt;
      &lt;/init-param&gt; --&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Application&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/service/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;login.html&lt;/welcome-file&gt;
  &lt;/welcome-file-list&gt;
    &lt;/web-app&gt;
  </code></pre>
  
  <p>Dependencies:-<a href="https://i.stack.imgur.com/74iwq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/74iwq.png" alt="enter image description here"></a></p>
  
  <p>I am not using maven ,kindly some one help me to resolve this</p>