struts2 <debug>标签报错:Caught an exception while getting the property values
码拜
java.lang.NullPointerException
at com.opensymphony.xwork2.ognl.OgnlUtil.getBeanInfo(OgnlUtil.java:398)
at com.opensymphony.xwork2.ognl.OgnlUtil.getPropertyDescriptors(OgnlUtil.java:344)
at com.opensymphony.xwork2.ognl.OgnlUtil.getBeanMap(OgnlUtil.java:375)
at com.opensymphony.xwork2.ognl.OgnlReflectionProvider.getBeanMap(OgnlReflectionProvider.java:97)
at org.apache.struts2.components.Debug.start(Debug.java:71)
at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:53)
at org.apache.jsp.WEB_002dINF.jsp.member2Restaurant.searchPartner_jsp._jspx_meth_s_005fdebug_005f0(searchPartner_jsp.java:272)
at org.apache.jsp.WEB_002dINF.jsp.member2Restaurant.searchPartner_jsp._jspService(searchPartner_jsp.java:183)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
at org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:164)
at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:374)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:278)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:236)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at cn.com.eatlab.web.AuthInterceptor.intercept(AuthInterceptor.java:74)
………..
ERROR ExceptionMappingInterceptor:38 – Caught an exception while getting the property values of null– Class: com.opensymphony.xwork2.ognl.OgnlUtil
File: OgnlUtil.java
Method: getBeanInfo
Line: 398 – com/opensymphony/xwork2/ognl/OgnlUtil.java:398:-1
org.apache.jasper.JasperException: Caught an exception while getting the property values of null – Class: com.opensymphony.xwork2.ognl.OgnlUtil
File: OgnlUtil.java
Method: getBeanInfo
Line: 398 – com/opensymphony/xwork2/ognl/OgnlUtil.java:398:-1
at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:549)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
debug进去到Debug.class文件发现这样一段代码:
public boolean start(Writer writer) {
boolean result = super.start(writer);
ValueStack stack = getStack();
Iterator iter = stack.getRoot().iterator();
List stackValues = new ArrayList(stack.getRoot().size());
while (iter.hasNext()) {
Object o = iter.next();
Map values;
try {
values = reflectionProvider.getBeanMap(o);//此处报错
} catch (Exception e) {
throw new StrutsException("Caught an exception while getting the property values of " + o, e);
}
stackValues.add(new DebugMapEntry(o.getClass().getName(), values));
}
addParameter("stackValues", stackValues);
return result;
}