title: Return an array with jersey
body: <p>I am trying to make a sample REST server with jersey. I am able to retrun a simple String but when I try to return an Array I get this error </p>
  
  <pre><code> A message body writer for Java class [C, and Java type class [C, and MIME media type application/json was not found.
  </code></pre>
  
  <p>I also tried to add @XMLRootElement but the problem remain. This is my code:</p>
  
  <pre><code>@Path("/test") 
  
  public class Test {
  
      @GET
      @Produces( MediaType.APPLICATION_JSON )
      public char[] getHello() {
  
          char[] test = { 'd', 'e', 'c', 'a', 'f', 'f', 'e',
                  'i', 'n', 'a', 't', 'e', 'd' };
          return test;
      }
  }
  </code></pre>
  
  <p><strong>Edit: pom.xml added</strong></p>
  
  <pre><code>&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"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;HospitalServer&lt;/groupId&gt;
    &lt;artifactId&gt;HospitalServer&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;war&lt;/packaging&gt;
  
    &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;maven2-repository.java.net&lt;/id&gt;
              &lt;name&gt;Java.net Repository for Maven&lt;/name&gt;
              &lt;url&gt;http://download.java.net/maven/2/&lt;/url&gt;
              &lt;layout&gt;default&lt;/layout&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
  
      &lt;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;1.8&lt;/version&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt;
  
    &lt;build&gt;
      &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
          &lt;version&gt;3.3&lt;/version&gt;
          &lt;configuration&gt;
            &lt;source&gt;1.8&lt;/source&gt;
            &lt;target&gt;1.8&lt;/target&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.6&lt;/version&gt;
          &lt;configuration&gt;
            &lt;warSourceDirectory&gt;WebContent&lt;/warSourceDirectory&gt;
            &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>