title: Can't find bundle for base name javax.servlet.LocalStrings on a simple servlet code
body: <p>I'm trying to learn using servlets and JSPs.  I wanted to test out how it worked through NetBeans (using Glassfish Server). I created a web project (Java Ant for Web) and added a servlet. I didn't modify it heavily as I was only testing. I deployed it and the index.jsp worked but when I try accessing the servlet through the mapping, I am getting a HTTP 500 error.</p>
  <blockquote>
  <p><strong>exception</strong> jakarta.servlet.ServletException: Error instantiating servlet class test.MyDateServlet</p>
  <p><strong>root cause</strong> java.lang.ExceptionInInitializerError</p>
  <p><strong>root cause</strong> java.util.MissingResourceException: Can't find bundle for base name javax.servlet.LocalStrings, locale en_US</p>
  </blockquote>
  <p>web.xml</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;web-app version=&quot;2.5&quot; xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot;&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;MyDateServlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;test.MyDateServlet&lt;/servlet-class&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;MyDateServlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/MyDateServlet&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
      &lt;session-config&gt;
          &lt;session-timeout&gt;
              30
          &lt;/session-timeout&gt;
      &lt;/session-config&gt;
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  &lt;/web-app&gt;
  </code></pre>
  <p>MyDateServlet.java</p>
  <pre><code>/*
   * To change this license header, choose License Headers in Project Properties.
   * To change this template file, choose Tools | Templates
   * and open the template in the editor.
   */
  package test;
  
  import java.io.IOException;
  import java.io.PrintWriter;
  import javax.servlet.ServletException;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  /**
   *
   * @author FE
   */
  public class MyDateServlet extends HttpServlet {
  
      /**
       * Processes requests for both HTTP &lt;code&gt;GET&lt;/code&gt; and &lt;code&gt;POST&lt;/code&gt;
       * methods.
       *
       * @param request servlet request
       * @param response servlet response
       * @throws ServletException if a servlet-specific error occurs
       * @throws IOException if an I/O error occurs
       */
      protected void processRequest(HttpServletRequest request, HttpServletResponse response)
              throws ServletException, IOException {
          response.setContentType(&quot;text/html;charset=UTF-8&quot;);
          try (PrintWriter out = response.getWriter()) {
              /* TODO output your page here. You may use following sample code. */
              out.println(&quot;&lt;!DOCTYPE html&gt;&quot;);
              out.println(&quot;&lt;html&gt;&quot;);
              out.println(&quot;&lt;head&gt;&quot;);
              out.println(&quot;&lt;title&gt;Servlet MyDateServlet (Servlet version) &lt;/title&gt;&quot;);            
              out.println(&quot;&lt;/head&gt;&quot;);
              out.println(&quot;&lt;body&gt;&quot;);
              out.println(&quot;&lt;h1&gt;Today's date is:  &quot; + request.getContextPath() + &quot;&lt;/h1&gt;&quot;);
              out.println(new java.util.Date());
              out.println(&quot;&lt;/body&gt;&quot;);
              out.println(&quot;&lt;/html&gt;&quot;);
          }
      }
  
      // &lt;editor-fold defaultstate=&quot;collapsed&quot; desc=&quot;HttpServlet methods. Click on the + sign on the left to edit the code.&quot;&gt;
      /**
       * Handles the HTTP &lt;code&gt;GET&lt;/code&gt; method.
       *
       * @param request servlet request
       * @param response servlet response
       * @throws ServletException if a servlet-specific error occurs
       * @throws IOException if an I/O error occurs
       */
      @Override
      protected void doGet(HttpServletRequest request, HttpServletResponse response)
              throws ServletException, IOException {
          processRequest(request, response);
      }
  
      /**
       * Handles the HTTP &lt;code&gt;POST&lt;/code&gt; method.
       *
       * @param request servlet request
       * @param response servlet response
       * @throws ServletException if a servlet-specific error occurs
       * @throws IOException if an I/O error occurs
       */
      @Override
      protected void doPost(HttpServletRequest request, HttpServletResponse response)
              throws ServletException, IOException {
          processRequest(request, response);
      }
  
      /**
       * Returns a short description of the servlet.
       *
       * @return a String containing servlet description
       */
      @Override
      public String getServletInfo() {
          return &quot;Short description&quot;;
      }// &lt;/editor-fold&gt;
  
  }
  </code></pre>
  <p>This is a really simple code with minimal revisions but I'm not too sure why I'm getting the error. My java is updated, and I'm currently using Java EE 7 API in my library.</p>