title: Java EE project can't find Gson
body: <p>I'm building a Java EE project for class, and am attempting to use Google's Gson package to send JSON to another part of my project inside of a Servlet. When I visit the URL mapped to the aforementioned Servlet, I expect to see the raw JSON, however I get a <code>ClassNotFoundException</code>.</p>
  
  <pre><code>import com.google.gson.Gson;
  import edu.neumont.writingCenter.json.Event;
  
  import javax.servlet.ServletException;
  import javax.servlet.annotation.WebServlet;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  import java.io.IOException;
  import java.io.PrintWriter;
  import java.util.ArrayList;
  import java.util.Date;
  import java.util.List;
  
  
  @WebServlet("/user/appointments/json")
  public class UserAppointmentsJsonServlet extends HttpServlet {
      protected void doGet(HttpServletRequest request, 
                           HttpServletResponse response) 
                                          throws ServletException, IOException {
          response.setContentType("application/json");
          PrintWriter out = response.getWriter();
  
          List&lt;Event&gt; events = new ArrayList&lt;Event&gt;();
          for (int i =0; i &lt; 10; i++) {
              Event event = new Event();
              event.setId(i);
              event.setTitle("Test " + i);
              event.setAllDay(false);
              event.setStart(new Date());
              event.setEnd(new Date());
              events.add(event);
          }
  
          Gson gson = new Gson();
          out.print(gson.toJson(events));
          out.flush();
  
      }
  }
  </code></pre>
  
  <blockquote>
    <p>java.lang.NoClassDefFoundError: com/google/gson/Gson  at
    edu.neumont.writingCenter.servlets.user.appointments.UserAppointmentsJsonServlet.doGet(UserAppointmentsJsonServlet.java:35)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)     at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:847)  at
    org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
      at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
      at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
      at
    edu.neumont.writingCenter.filters.SetRootFilter.doFilter(SetRootFilter.java:43)
      at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
      at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
      at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
      at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at
    org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
      at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
      at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)   at
    com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
      at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
      at
    org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
      at
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
      at
    com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
      at
    com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
      at
    com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
      at
    com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
      at
    com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
      at
    com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
      at
    com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
      at
    com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
      at
    com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
      at
    com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
      at
    com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
      at com.sun.grizzly.ContextTask.run(ContextTask.java:71)     at
    com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
      at
    com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
      at java.lang.Thread.run(Thread.java:662) Caused by:
    java.lang.ClassNotFoundException: com.google.gson.Gson    at
    org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1519)
      at
    org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1369)
      ... 33 more</p>
  </blockquote>