title: Glassfish JAX-RS JSON Mapping Simple Example Internal Server Error 500 No Logs Produced
body: <p>I have created a simple REST service with two resources. The first resource works great and just returns MediaType.TEXT_PLAIN.</p>
  
  <p>For the second resource I wanted to try mapping POJO to Java and followed this example:</p>
  
  <p><a href="https://github.com/jersey/jersey/tree/2.3.1/examples/json-moxy/src/main/java/org/glassfish/jersey/examples/jsonmoxy" rel="nofollow noreferrer">https://github.com/jersey/jersey/tree/2.3.1/examples/json-moxy/src/main/java/org/glassfish/jersey/examples/jsonmoxy</a></p>
  
  <p>with my testbean defined as:</p>
  
  <pre><code>@XmlRootElement
  public class Company {
  
      public String name;
      public String symbol;
      public String country;
  
      public Company(String name, String symbol,
              String country) {
          this.name = name;
          this.symbol = symbol;
          this.country = country;
      }
  
      public String getName() {
          return name;
      }
  
      public String getSymbol() {
          return symbol;
      }
  
      public String getCountry() {
          return country;
      }
  }
  </code></pre>
  
  <p>The resource is trivial as well:</p>
  
  <pre><code>@Path("company/{name}")
  public class CompanyResource {
  
      private Map&lt;String, Company&gt; companies;
  
      public CompanyResource() {
          companies = new LinkedHashMap&lt;String, Company&gt;();
          companies.put("Apple", new Company("Apple Inc.", "AAPL", "USA"));
          companies.put("Microsoft", new Company("Microsoft Corp.", "MSFT", "USA"));
          companies.put("Honda", new Company("Honda Motor Co Ltd", "HMC", "Japan"));
          companies.put("Random", new Company("Random Inc.", "RND", "Undefined"));
      }
  
      @GET
      @Produces(MediaType.APPLICATION_JSON)
      public Company getCompany(@PathParam("name") String name) {
          Company cmp = companies.get(name);
          if (cmp == null) {
              return companies.get("Random");
          }
          return cmp;
      }
  }
  </code></pre>
  
  <p>I have debugged a request and arrive at the return statement without problems. From here however, I think a JAXBException is thrown but I am unable to view the details, and nothing appears in any log anywhere. All that happens is that the browser display an "internal server error 500" message.</p>
  
  <p>Under monitoring configuration I have in desperation set everything to level HIGH. Still nothing appears anywhere.</p>
  
  <p>The only similar questions I found were <a href="https://stackoverflow.com/questions/16565881/jax-rs-2-0-and-glassfish-4-unable-to-consume-json-into-pojo">jax-rs 2.0 and Glassfish 4 unable to @consume JSON into Pojo</a> and <a href="https://stackoverflow.com/questions/17503748/jax-rs-jersey-json-http-500-internal-server-error">JAX RS Jersey + JSON --&gt; HTTP 500 Internal Server Error</a> but they didn't seem entirely related.</p>
  
  <p>For client I am simply using Google Chrome with the "Advanced REST Client" app.</p>
  
  <p>Any help would be much appreciated.</p>