title: Could not initialize class org.eclipse.persistence.jaxb.BeanValidationHelper
body: <p>I have been trying to get a dto object in json format as a response from my webservice. Webservice is developed in Spring Framework. But, whenever I try to access my application either from curl or from browser it gives me following exception on server-side.</p>
  
  <blockquote>
    <p>java.lang.NoClassDefFoundError: Could not initialize class
    org.eclipse.persistence.jaxb.BeanValidationHelper</p>
  </blockquote>
  
  <p>My dto is something like this:</p>
  
  <pre><code>public class UserDto {
    @JsonProperty 
      private String id;
    @JsonProperty
      private String userRole;
  //.... Getter &amp; Setters skipped
  }
  </code></pre>
  
  <p>My controller method is like:</p>
  
  <pre><code>    @GET
      @Path("getUser")
      @Produces({"application/xml",MediaType.APPLICATION_JSON_VALUE})
      public  UserDto GetLoggedinUser() {
          return new UserDto("wasif kirmani");
      }
  </code></pre>
  
  <p>I don't know where am I going wrong?</p>
  
  <p>Environment:
  Server: GlassFish 4.1.1
  Java: 6EE</p>