title: HTTP Status 500 - org.apache.jasper.JasperException: java.lang.NullPointerException
body: <p>I deployed my project on the production server and getting the below error.</p>
  
  <p>It's a live project so , after getting error i replaced this with previous version that was running fine but now that is also throwing the same error.Please suggest me what could be the problem ?</p>
  
  <p>error:</p>
  
  <pre><code>HTTP Status 500 - org.apache.jasper.JasperException: java.lang.NullPointerException
  
  --------------------------------------------------------------------------------
  
  type Exception report
  
  message org.apache.jasper.JasperException: java.lang.NullPointerException
  
  description The server encountered an internal error that prevented it from fulfilling this request.
  
  exception 
  
  org.apache.jasper.JasperException: org.apache.jasper.JasperException: java.lang.NullPointerException
      org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:502)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:412)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  
  
  root cause 
  
  org.apache.jasper.JasperException: java.lang.NullPointerException
      org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:502)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:430)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:709)
      org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:680)
      org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:821)
      org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:794)
      org.apache.jsp.LPSSuppIndex_jsp._jspService(LPSSuppIndex_jsp.java:393)
      org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  
  
  root cause 
  
  java.lang.NullPointerException
      org.apache.jsp.error_jsp._jspService(error_jsp.java:124)
      org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:709)
      org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:680)
      org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:821)
      org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:794)
      org.apache.jsp.LPSSuppIndex_jsp._jspService(LPSSuppIndex_jsp.java:393)
      org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  
  
  note The full stack trace of the root cause is available in the Apache Tomcat/6.0.36 logs.
  
  
  --------------------------------------------------------------------------------
  
  Apache Tomcat/6.0.36
  </code></pre>
  
  <p>IndexPage.jsp :</p>
  
  <pre><code>&lt;%@ page errorPage="error.jsp"%&gt;
  &lt;%@ page import="java.util.*" %&gt;
  &lt;%@ page import = "jdbc.RetrieveLangList,lang.MessageGetter" %&gt;
  &lt;%!
      HashMap&lt;String, String&gt; langListMap = new HashMap&lt;String, String&gt;();
  %&gt;
  &lt;%
          //Retrieving language MAP
          RetrieveLangList objList = new RetrieveLangList();
          langListMap = objList.LangList();
          Set s = langListMap.entrySet(); // Get hashmap in Set interface to get key and value
          Iterator it = s.iterator(); // Move next key and value of HashMap by iterator
  
          String suppLang = "en_US";
          suppLang = request.getParameter("suppLanguage");
          if (suppLang == null || suppLang.equalsIgnoreCase(""))
              suppLang = "en_US";
  %&gt;
  &lt;html&gt;
  &lt;HEAD&gt;
  &lt;TITLE&gt; Welcome to  &lt;/TITLE&gt;
  &lt;link rel="SHORTCUT ICON" href="image/H.ico"/&gt;
  &lt;LINK href="image/css/Rcontent.css" type="text/css" rel="stylesheet"&gt;
  &lt;/HEAD&gt;
  &lt;script language="JavaScript"&gt;
  function loadPage(list)
  {
    location.href=list.options[list.selectedIndex].value;
  }
  &lt;/script&gt;
  &lt;SCRIPT language="Javascript"&gt;
      function ValidateForm()
      {
      //Supplier Number Validation
      var supp_number =document.loginForm.uname;
  
      if((supp_number.value=="su")||(supp_number.value=="SU"))
          {
              return true;
          }
  
      var stripped = supp_number.value.replace(/[\(\)\.\-\ ]/g, ''); 
      if((supp_number.value==null)||(supp_number.value==""))
          {
          alert("&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "Enter_User_ID")%&gt;");
          supp_number.focus();
          return false;
          }
      else if (isNaN(parseInt(stripped))) {
          alert("&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "Invalid_User_ID")%&gt;");
          supp_number.focus();
          return false;
           }
  
          //Password Validation
          var supp_pass =document.loginForm.pass;
      if((supp_pass.value==null)||(supp_pass.value==""))
          {
          alert("&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "Enter_Password")%&gt;");
          //alert("Please Enter Password");
          supp_pass.focus();
          return false;
          }
      return true;
      }
  &lt;/SCRIPT&gt;
  &lt;BODY bgcolor="#C7CACF"&gt;
  &lt;center&gt;
  &lt;table border = "0" bordercolor = "black" style="background-image:url('image/backgroundIndex.jpg');background-repeat:no-repeat" width="1000" HEIGHT = "700" &gt;
  &lt;tr height = "60"&gt;
      &lt;td&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td colspan="2"&gt;
      &lt;form name="form1" &gt;
      &lt;TABLE border="0" width = "610"&gt;
      &lt;TR&gt;
         &lt;td width="300" align="right" height="40"&gt;
              &lt;select name="file" size="1" onchange="loadPage(this.form.elements[0])" target="_parent._top"  onmouseclick="this.focus()" style="background-color: #ffffff;width:150px;"&gt; &lt;!-- This is language selection box --&gt;
              &lt;%
              while (it.hasNext())
              {
                  Map.Entry m = (Map.Entry) it.next(); // key=value separator this by Map.Entry to get key and value
                  //System.out.println("value : "+m.getValue()+" key : "+m.getKey());
                  if(suppLang.equals(m.getKey()))
                  {
              %&gt;
              &lt;option value="LPSSuppIndex.jsp?suppLanguage=&lt;%= m.getKey()%&gt;" selected="selected"&gt;&lt;%= m.getValue()%&gt;&lt;/option&gt;
              &lt;%
                  }
                  else
                  {
              %&gt;
              &lt;option value="LPSSuppIndex.jsp?suppLanguage=&lt;%= m.getKey()%&gt;"&gt;&lt;%= m.getValue()%&gt;&lt;/option&gt;
              &lt;%
                  }
              }
              %&gt;
              &lt;/select&gt;
           &lt;/td&gt;
           &lt;td width = "300px" align="right"&gt;&lt;a HREF="mailto:?subject=&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "sub_contact")%&gt;&amp;body=&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "body_line1_contact")%&gt;, %0D%0D%0D&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "body_line2_contact")%&gt;, %0D%0D%0D&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "body_line3_contact")%&gt;%0D%0D%0D"&gt;&lt;font color="#73767B" size="2"&gt;&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "contact")%&gt;&lt;/font&gt;&lt;/a&gt;&lt;font color="#73767B"&gt;&lt;B&gt; |&lt;/B&gt;&lt;/font&gt;&lt;a href="http://www..com/en/service/imprint-legal-issues.html"&gt;&lt;font color="#73767B" size="2"&gt; &lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "imprint_legel_issue")%&gt;&lt;/font&gt;&lt;/a&gt;&lt;font color="#73767B"&gt;&lt;B&gt; | &lt;/B&gt;&lt;/font&gt;&lt;a href="http://www..com/en/service/sitemap.html"&gt;&lt;font color="#73767B" size="2"&gt;&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "sitemap")%&gt;&lt;/font&gt;&lt;/a&gt;&lt;/td&gt;
      &lt;/TR&gt;
      &lt;TR height="12px"&gt;
          &lt;TD colspan="2"&gt;&amp;nbsp;&lt;/TD&gt;
      &lt;/TR&gt;
      &lt;/TABLE&gt;
      &lt;/form&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
       &lt;td height = "240px" valign="top"&gt;
          &lt;TABLE border="0" width = "195"&gt;
          &lt;TR&gt;
              &lt;TD height="40" width="155" align="left"&gt;&lt;div style="position:relative;left: 20px;"&gt;&lt;a href="LPSSuppIndex.jsp"&gt;&lt;font color="#73767B" size="3"&gt;&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "home")%&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;/TD&gt;
          &lt;/TR&gt;
          &lt;TR&gt;
              &lt;TD height="37" align="left"&gt;&lt;div style="position:relative;left: 20px;"&gt;&lt;A HREF="mailto:er_Admin@de..com?subject=&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "sub_contact")%&gt;&amp;body=&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "body_line1_contact")%&gt;, %0D%0D%0D&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "body_line2_contact")%&gt;, %0D%0D%0D&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "body_line3_contact")%&gt;%0D%0D%0D"&gt;&lt;font color="#73767B"&gt;&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "contact")%&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;/TD&gt;
          &lt;/TR&gt;
          &lt;TR&gt;
              &lt;TD height="35" align="left"&gt;&lt;div style="position:relative;left: 20px;"&gt;&lt;a href="LPSSuppIndex.jsp"&gt;&lt;font color="#73767B" size="3"&gt;&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "log_in")%&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;/TD&gt;
          &lt;/TR&gt;
          &lt;TR&gt;
              &lt;TD height="34" align="left"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href="http://wwwcom"&gt;&lt;font color="white" style="font-family:Arial, Helvetica, sans-serif;font-size: 10pt; font-weight: bold"&gt;&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "tportal")%&gt;&lt;/font&gt;&lt;/a&gt;&lt;/TD&gt;
          &lt;/TR&gt;
          &lt;TR&gt;
              &lt;TD height = "32" align="center"&gt;&amp;nbsp;&lt;/TD&gt;
          &lt;/TR&gt;
          &lt;TR&gt;
              &lt;TD height = "43px" colspan="2" align="center"&gt;&amp;nbsp;&lt;/TD&gt;
          &lt;/TR&gt;
  
          &lt;/TABLE&gt;
      &lt;/td&gt;
  
      &lt;td colspan="2"&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td rowspan="3" valign="top"&gt;
          &lt;table border="0px" &gt;
              &lt;tr height="139px"&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
              &lt;tr height="431px"&gt;
                  &lt;td valign="top" width="8px"&gt;&lt;div class="vertical-line" style="position:relative;left:27px;top:0px;"&gt;&lt;/div&gt;&lt;/td&gt;
                  &lt;td valign="top"&gt;
                      &lt;!-- START RIGHT CONTENT  --&gt;
  
                      &lt;DIV class="cntr_cnt_gradbox" style="position: relative;left: 15px;top: -5px;"&gt;
                      &lt;DIV class="cntr_head"&gt;&lt;font size="2%"&gt;&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "PDF_download")%&gt;&amp;nbsp;&lt;/font&gt;&lt;/DIV&gt;
                      &lt;DIV class="cntr_cnt_gradbox_inner"&gt;
                          &lt;DIV class="cntr_frame" style="height: 60px;"&gt;
                              &lt;DIV style="FLOAT: left;height: 50px;" &gt;
                                  &lt;IMG src="image/PDF_Thumbnail_50x50.gif" border="0"&gt;
                              &lt;/DIV&gt;
                              &lt;DIV class="cntr_dl_cnt" style="MARGIN-LEFT: 55px;"&gt;
                                  &lt;A class="cntr_lnk" href="PDF/User Maner_EN.pdf" target="_blank"&gt;&lt;font color="#73767B" size="2%"&gt;&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "manual_en")%&gt;&lt;/font&gt;&lt;/A&gt;
                              &lt;/DIV&gt;&amp;nbsp;
                              &lt;BR class="clr"&gt;
                          &lt;/DIV&gt;
                          &lt;BR class="clr"&gt;
                          &lt;DIV class="cntr_frame" style="height: 60px;"&gt;
                              &lt;DIV style="FLOAT: left;height: 50px;" &gt;
                                  &lt;IMG src="image/PDF_Thumbnail_50x50.gif" border="0"&gt;
                              &lt;/DIV&gt;
                              &lt;DIV class="cntr_dl_cnt" style="MARGIN-LEFT: 55px;"&gt;
                                  &lt;A class="cntr_lnk" href="PDF/Benutzerhl Printer_DE.pdf" target="_blank"&gt;&lt;font color="#73767B" size="2%"&gt;&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "manual_de")%&gt;&lt;/font&gt;&lt;/A&gt;
                              &lt;/DIV&gt;&amp;nbsp;
                              &lt;BR class="clr"&gt;
                          &lt;/DIV&gt;
                          &lt;BR class="clr"&gt;
                          &lt;DIV class="cntr_frame" style="height: 60px;"&gt;
                              &lt;DIV style="FLOAT: left;height: 50px;" &gt;
                                  &lt;IMG src="image/PDF_Thumbnail_50x50.gif" border="0"&gt;
                              &lt;/DIV&gt;
                              &lt;DIV class="cntr_dl_cnt" style="MARGIN-LEFT: 55px;"&gt;
                                  &lt;A class="cntr_lnk" href="PDF/Print_Specification.pdf" target="_blank" title="&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "printHelp_tip")%&gt;"&gt;&lt;font color="#73767B" size="2%"&gt;&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "printHelp")%&gt;&lt;/font&gt;&lt;/A&gt;
                              &lt;/DIV&gt;
                              &lt;BR class="clr"&gt;
                          &lt;/DIV&gt;
                          &lt;DIV class="cntr_frame1" style="height: 30px;"&gt;
                               &lt;div style="margin-left: 30px;"&gt; &lt;A class="cntr_lnk" href="PDF/quick_guide_en.pdf" target="_blank"&gt;&lt;font color="#73767B" size="2%"&gt;&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "one_point_lessons")%&gt; - EN&lt;/font&gt;&lt;/A&gt;&lt;/div&gt;
                          &lt;/DIV&gt;
  
                          &lt;DIV class="cntr_frame1" style="height: 30px;"&gt;
                               &lt;div style="margin-left: 30px;"&gt; &lt;A class="cntr_lnk" href="PDF/quick_guide_de.pdf" target="_blank"&gt;&lt;font color="#73767B" size="2%"&gt;&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "one_point_lessons")%&gt; - DE&lt;/font&gt;&lt;/A&gt;&lt;/div&gt;
                          &lt;/DIV&gt;
                          &lt;DIV style="height: 30px;vertical-align: middle;"&gt;
                               &lt;div style="margin-left: 30px;"&gt; &lt;A class="cntr_lnk" href="PDF/FAQ.pdf" target="_blank"&gt;&lt;font color="#73767B" size="2%"&gt;FAQ&lt;/font&gt;&lt;/A&gt;&lt;/div&gt;
                          &lt;/DIV&gt;
                          &lt;/DIV&gt;
                      &lt;/DIV&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr height = "210"&gt;
      &lt;td&gt;&amp;nbsp;&lt;/td&gt;
       &lt;td&gt;&amp;nbsp;&lt;/td&gt;
       &lt;td&gt;
       &lt;form method="post" name="loginForm" action="./loginServlet" onsubmit="return ValidateForm()"&gt;
       &lt;input type="hidden" name="selectedLang" value="&lt;%=suppLang%&gt;" &gt;
       &lt;TABLE border="0" bordercolor="black" width="370"&gt;
       &lt;tr&gt;&lt;td rowspan="6" width = "30"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
  
       &lt;TR height="45"&gt;
          &lt;td width="110" &gt;&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "user_id")%&gt; : &lt;/td&gt;&lt;!-- This is Supplier Number(User ID) entry field. --&gt;
       &lt;td width="230" align="center"&gt;&lt;input type="text" size="25" name="uname" style="border-color: #529DFA;" maxlength="10"&gt;&lt;/td&gt;
       &lt;/TR&gt;
       &lt;TR&gt;
       &lt;td height="45"&gt;&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "Password")%&gt; : &lt;/td&gt;&lt;!-- This is Password entry field. --&gt;
        &lt;td align="center"&gt;&lt;input type="password" size="25" name="pass" style="border-color: #529DFA;"&gt;&lt;/td&gt;
       &lt;/TR&gt;
       &lt;TR height="40"&gt;
       &lt;td&gt;&amp;nbsp;&lt;/td&gt;
       &lt;td align ="center" height="40"&gt;&lt;A HREF="mailto_Printer_Admin@de.h.com?subject=&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "sub_forget_password")%&gt;&amp;body=&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "body_line1_forget_password")%&gt;, %0D%0D%0D&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "body_line2_forget_password")%&gt;%0D%0D%0D"&gt;&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "forget_password")%&gt;&lt;/A&gt;
      &lt;/td&gt;
       &lt;/TR&gt;
       &lt;TR&gt;   
       &lt;td height="40" align="right"&gt;&lt;input type="Submit" value="&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "log_in")%&gt;" /&gt; &lt;/td&gt;
       &lt;td align="center"&gt;&lt;input type="button" onClick="location.href='register/suppRegistration.jsp?selectedLang=&lt;%=suppLang%&gt;'" value="&lt;%=MessageGetter.getMessage("lang.MessagesBundle", suppLang, "new_user")%&gt;" /&gt;&lt;/td&gt;
       &lt;/TR&gt;
       &lt;/TABLE&gt;&lt;/form&gt;
       &lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr height = "114"&gt;
      &lt;td&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td&gt;&amp;nbsp;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
      &lt;td width = "200"&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td width="170"&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td width="380"&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td width="230" align="center"&gt;&amp;nbsp;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/center&gt;
  &lt;/BODY&gt;
  &lt;/HTML&gt;
  </code></pre>