title: Jersey Jackson JSON class name not being generated
body: <p>Hey there so basically I am trying to get the class names to show up in my JSON response.  So instead of this: </p>
  
  <pre><code>{"username":"MYANCHEK","token":"3b6037c7-e7b3-4e9a-8271-a63adda89371","active":true,"verified":true}
  </code></pre>
  
  <p>I am expecting to get this:</p>
  
  <pre><code>{authenticatedUser: {"username":"MYANCHEK","token":"3b6037c7-e7b3-4e9a-8271-a63adda89371","active":true,"verified":true}}
  </code></pre>
  
  <p>I have tried @XMLRootElement( name = "authenticatedUser" ), as well as @JsonRootName(value = "authenticatedUser") and also a bunch of combination of @XMLAccessType</p>
  
  <p>Here is my actual class:</p>
  
  <pre><code>@XmlRootElement(name = "authenticatedUser")
  @JsonRootName(value = "authenticatedUser")
  public class AuthenticatedUser implements Principal {
  
      @JsonIgnore
      private long id;
      private String username;
      private String token;
      private boolean active;
  
      private boolean verified;
  
      public AuthenticatedUser(User user, String sessionToken) {
          this.id = user.getUserId();
          this.token = sessionToken;
          this.username = user.getUsername();
          this.active = user.getAccountActive();
          this.verified = user.getVerified();
      }
  
      public AuthenticatedUser(User user, SessionToken activeSession) {
          this(user, activeSession.getToken());
      }
  
      public String getUsername() {
          return username;
      }
  
      public void setUsername(String username) {
          this.username = username;
      }
  
      public String getToken() {
          return token;
      }
  
      @JsonIgnore
      public String getName() {
          return username;
      }
  
      public boolean isActive() {
          return active;
      }
  
      public boolean isVerified() {
          return verified;
      }
  }
  </code></pre>
  
  <p>And here is what my web.xml file looks like:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
      version="2.4"&gt;
      &lt;display-name&gt;my-services&lt;/display-name&gt;
  
      &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;/WEB-INF/spring/servlet-context.xml&lt;/param-value&gt;
      &lt;/context-param&gt;
  
      &lt;listener&gt;
          &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
      &lt;/listener&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;jersey-servlet&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
      &lt;filter&gt;
          &lt;filter-name&gt;jersey-servlet&lt;/filter-name&gt;
          &lt;filter-class&gt;com.sun.jersey.spi.spring.container.servlet.SpringServlet&lt;/filter-class&gt;
  
          &lt;init-param&gt;
              &lt;param-name&gt;com.sun.jersey.config.property.packages&lt;/param-name&gt;
              &lt;param-value&gt;com.mywebapp.soa.resource&lt;/param-value&gt;
          &lt;/init-param&gt;
  
          &lt;init-param&gt;
              &lt;param-name&gt;com.sun.jersey.api.json.POJOMappingFeature&lt;/param-name&gt;
              &lt;param-value&gt;true&lt;/param-value&gt;
          &lt;/init-param&gt;
  
          &lt;init-param&gt;
              &lt;param-name&gt;com.sun.jersey.spi.container.ResourceFilters&lt;/param-name&gt;
              &lt;param-value&gt;com.mywebapp.soa.filter.ResourceFilterFactory&lt;/param-value&gt;
          &lt;/init-param&gt;
      &lt;/filter&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>And here is a snippet of my maven dependencies:</p>
  
  <p></p>
  
  <pre><code>&lt;!-- JAX-RS Dependencies --&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
      &lt;artifactId&gt;jersey-server&lt;/artifactId&gt;
      &lt;version&gt;${jersey.version}&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;com.sun.jersey.contribs&lt;/groupId&gt;
      &lt;artifactId&gt;jersey-spring&lt;/artifactId&gt;
      &lt;version&gt;${jersey.version}&lt;/version&gt;
      &lt;!-- Exclude Spring  --&gt;
      &lt;exclusions&gt;
          &lt;exclusion&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
          &lt;/exclusion&gt;
          &lt;exclusion&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
          &lt;/exclusion&gt;
          &lt;exclusion&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-beans&lt;/artifactId&gt;
          &lt;/exclusion&gt;
          &lt;exclusion&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-asm&lt;/artifactId&gt;
          &lt;/exclusion&gt;
      &lt;/exclusions&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
      &lt;artifactId&gt;jersey-json&lt;/artifactId&gt;
      &lt;version&gt;${jersey.version}&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;!-- Spring Dependencies --&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;org.springframework&lt;/groupId&gt;
      &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
      &lt;version&gt;3.2.1.RELEASE&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;org.springframework&lt;/groupId&gt;
      &lt;artifactId&gt;spring-beans&lt;/artifactId&gt;
      &lt;version&gt;3.2.1.RELEASE&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;org.springframework&lt;/groupId&gt;
      &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
      &lt;version&gt;3.2.1.RELEASE&lt;/version&gt;
      &lt;exclusions&gt;
          &lt;!-- Exclude Commons Logging in favor of SLF4j --&gt;
          &lt;exclusion&gt;
              &lt;groupId&gt;commons-logging&lt;/groupId&gt;
              &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
          &lt;/exclusion&gt;
      &lt;/exclusions&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;org.springframework&lt;/groupId&gt;
      &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
      &lt;version&gt;${spring.version}&lt;/version&gt;
      &lt;type&gt;jar&lt;/type&gt;
      &lt;scope&gt;compile&lt;/scope&gt;
  &lt;/dependency&gt;
  
  &lt;!-- DB Dependencies --&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;commons-dbcp&lt;/groupId&gt;
      &lt;artifactId&gt;commons-dbcp&lt;/artifactId&gt;
      &lt;version&gt;1.2.2&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;mysql&lt;/groupId&gt;
      &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
      &lt;version&gt;5.1.24&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;!-- JPA Persistence Dependencies --&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;org.hibernate.java-persistence&lt;/groupId&gt;
      &lt;artifactId&gt;jpa-api&lt;/artifactId&gt;
      &lt;version&gt;2.0-cr-1&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
      &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
      &lt;version&gt;${hibernate.version}&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
      &lt;artifactId&gt;hibernate-jpamodelgen&lt;/artifactId&gt;
      &lt;version&gt;1.1.1.Final&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;!-- Bean Validation Dependencies --&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;javax.validation&lt;/groupId&gt;
      &lt;artifactId&gt;validation-api&lt;/artifactId&gt;
      &lt;version&gt;1.1.0.Final&lt;/version&gt;
      &lt;scope&gt;compile&lt;/scope&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;javax.annotation&lt;/groupId&gt;
      &lt;artifactId&gt;jsr250-api&lt;/artifactId&gt;
      &lt;version&gt;1.0&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;javax.ws.rs&lt;/groupId&gt;
      &lt;artifactId&gt;jsr311-api&lt;/artifactId&gt;
      &lt;version&gt;1.1.1&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
      &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
      &lt;version&gt;4.0.0.GA&lt;/version&gt;
      &lt;scope&gt;compile&lt;/scope&gt;
  &lt;/dependency&gt;
  
  &lt;!-- Logging --&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
      &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
      &lt;version&gt;1.5.6&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;!-- Time Handling --&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;joda-time&lt;/groupId&gt;
      &lt;artifactId&gt;joda-time&lt;/artifactId&gt;
      &lt;version&gt;2.3&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;cglib&lt;/groupId&gt;
      &lt;artifactId&gt;cglib&lt;/artifactId&gt;
      &lt;version&gt;2.2&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p></p>