Пожалуйста, помогите решить следующую проблему.
Я сделал простое приложение Spring MVC JSP, и в промежутке я сталкиваюсь с приведенным ниже исключением нулевого указателя, однако это исключение будет очищено, когда я повторно запущу приложение или иногда требуется перезапустить мою службу администратора. Пожалуйста, сообщите.
Я просто пытаюсь отправить форму входа из jsp и получаю эту ошибку.
java.lang.NullPointerException
at com.sun.faces.context.ApplicationMap.get(ApplicationMap.java:97)
at org.springframework.web.jsf.FacesContextUtils.getWebApplicationContext(FacesContextUtils.java:51)
at org.springframework.web.jsf.FacesContextUtils.getRequiredWebApplicationContext(FacesContextUtils.java:81)
at org.springframework.web.jsf.el.SpringBeanFacesELResolver.getWebApplicationContext(SpringBeanFacesELResolver.java:90)
at org.springframework.web.jsf.el.SpringBeanFacesELResolver.getBeanFactory(SpringBeanFacesELResolver.java:78)
at org.springframework.beans.factory.access.el.SpringBeanELResolver.getValue(SpringBeanELResolver.java:50)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
at com.sun.faces.el.ChainTypeCompositeELResolver.getValue(ChainTypeCompositeELResolver.java:94)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:188)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:188)
at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:103)
at com.sun.el.parser.AstEmpty.getValue(AstEmpty.java:66)
at com.sun.el.parser.AstNot.getValue(AstNot.java:63)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:224)
at weblogic.servlet.jsp.ELHelper.evaluate(ELHelper.java:32)
at jsp_servlet._web_45_inf._jsp.__usertodolist._jspService(__usertodolist.java:175)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
..........
Открытый окончательный класс UserToDoList_jsp.java UserToDoList_jsp расширяет org.apache.jasper.runtime.HttpJspBase реализует org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List<String> _jspx_dependants;
private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_forEach_var_items;
private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_form_select_tabindex_path_onchange;
private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_set_value_target_property_nobody;
private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_form_form_name_modelAttribute_method_action;
private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_form_option_value_label_nobody;
private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_if_test;
private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_form_option_value_nobody;
private org.glassfish.jsp.api.ResourceInjector _jspx_resourceInjector;
public java.util.List<String> getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_jspx_tagPool_c_forEach_var_items = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_jspx_tagPool_form_select_tabindex_path_onchange = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_jspx_tagPool_c_set_value_target_property_nobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_jspx_tagPool_form_form_name_modelAttribute_method_action = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_jspx_tagPool_form_option_value_label_nobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_jspx_tagPool_c_if_test = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_jspx_tagPool_form_option_value_nobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
}
public void _jspDestroy() {
_jspx_tagPool_c_forEach_var_items.release();
_jspx_tagPool_form_select_tabindex_path_onchange.release();
_jspx_tagPool_c_set_value_target_property_nobody.release();
_jspx_tagPool_form_form_name_modelAttribute_method_action.release();
_jspx_tagPool_form_option_value_label_nobody.release();
_jspx_tagPool_c_if_test.release();
_jspx_tagPool_form_option_value_nobody.release();
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html;charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
_jspx_resourceInjector = (org.glassfish.jsp.api.ResourceInjector) application.getAttribute("com.sun.appserv.jsp.resource.injector");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("<!DOCTYPE html>\n");
out.write("<html>\n");
out.write(" <head>\n");
out.write(" <title>Home</title>\n");
out.write(" <div class=\"inset\">\n");
out.write(" ");
out.print(session.getAttribute("dateTime"));
out.write("\n");
out.write(" <h2> TO DO LIST </h2> \n");
out.write(" ");
out.print(session.getAttribute("user"));
out.write("\n");
out.write(" <!-- <link href=\"style.css\" rel=\"stylesheet\" type=\"text/css\"/>\n");
out.write(" -->\n");
out.write(" <script type=\"text/javascript\">\n");
out.write("\n");
out.write(" function changeFunc($i) {\n");
out.write(" alert($i \"Please select Approve or Reject\");\n");
out.write(" }\n");
out.write(" </script> \n");
out.write(" </head> \n");
out.write(" <body>\n");
out.write(" <form action=\"logout\" method=\"POST\">\n");
out.write(" <button type=\"submit\">Logout</button> \n");
out.write(" </form> \n");
out.write("\n");
out.write(" <form name=\"Add\" action=\"Adduser\" method=\"post\">\n");
out.write(" <button type=\"submit\">ADD</button> \n");
out.write("\n");
out.write(" </form>\n");
out.write(" <form name=\"Modify\" action=\"Modifyuser\" method=\"post\">\n");
out.write(" <button type=\"submit\">Modify</button> \n");
out.write("\n");
out.write(" </form>\n");
out.write(" ");
// form:form
org.springframework.web.servlet.tags.form.FormTag _jspx_th_form_form_0 = (org.springframework.web.servlet.tags.form.FormTag) _jspx_tagPool_form_form_name_modelAttribute_method_action.get(org.springframework.web.servlet.tags.form.FormTag.class);
_jspx_th_form_form_0.setPageContext(_jspx_page_context);
_jspx_th_form_form_0.setParent(null);
_jspx_th_form_form_0.setMethod("POST");
_jspx_th_form_form_0.setName("TransactionAction");
_jspx_th_form_form_0.setModelAttribute("action");
_jspx_th_form_form_0.setAction("transactionAction");
int[] _jspx_push_body_count_form_form_0 = new int[] { 0 };
try {
int _jspx_eval_form_form_0 = _jspx_th_form_form_0.doStartTag();
if (_jspx_eval_form_form_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\n");
out.write(" ");
// c:if
org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_if_0 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _jspx_tagPool_c_if_test.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class);
_jspx_th_c_if_0.setPageContext(_jspx_page_context);
_jspx_th_c_if_0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_form_form_0);
_jspx_th_c_if_0.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${not empty ToDoList}", java.lang.Boolean.class, (PageContext)_jspx_page_context, null)).booleanValue());
int _jspx_eval_c_if_0 = _jspx_th_c_if_0.doStartTag();
if (_jspx_eval_c_if_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\n");
out.write("\n");
out.write(" <table>\n");
out.write("\n");
out.write(" <tr> <th>ID</th>\n");
out.write(" <th>LOGIN ID</th>\n");
out.write(" <th>MAKER</th>\n");
out.write(" <th>TRANSACTION TYPE</th>\n");
out.write(" <th>STATUS</th>\n");
out.write(" </tr> \n");
out.write(" ");
// c:forEach
org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_forEach_0 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _jspx_tagPool_c_forEach_var_items.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class);
_jspx_th_c_forEach_0.setPageContext(_jspx_page_context);
_jspx_th_c_forEach_0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_if_0);
_jspx_th_c_forEach_0.setVar("item");
_jspx_th_c_forEach_0.setItems((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${ToDoList}", java.lang.Object.class, (PageContext)_jspx_page_context, null));
int[] _jspx_push_body_count_c_forEach_0 = new int[] { 0 };
try {
int _jspx_eval_c_forEach_0 = _jspx_th_c_forEach_0.doStartTag();
if (_jspx_eval_c_forEach_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\n");
out.write(" <tr>\n");
out.write(" <td> <input value=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${item[0]}", java.lang.String.class, (PageContext)_jspx_page_context, null));
out.write("\" type=\"number\" name=\"id\" readonly /></td>\n");
out.write(" <td> <input value=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${item[1]}", java.lang.String.class, (PageContext)_jspx_page_context, null));
out.write("\" type=\"text\" name=\"loginId\" readonly /></td>\n");
out.write(" <td> <input value=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${item[2]}", java.lang.String.class, (PageContext)_jspx_page_context, null));
out.write("\" type=\"text\" name=\"maker\" readonly /></td>\n");
out.write(" <td> <input value=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${item[3]}", java.lang.String.class, (PageContext)_jspx_page_context, null));
out.write("\" type=\"text\" name=\"transactionType\" readonly /></td>\n");
out.write(" <td> <input value=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${item[4]}", java.lang.String.class, (PageContext)_jspx_page_context, null));
out.write("\" type=\"text\" name=\"status\" readonly /></td>\n");
out.write(" <td>\n");
out.write(" ");
// form:select
...
}