weblogic下 struts-jasperreport-plugin.jar 问题
weblogic下 struts-jasperreport-plugin.jar 报错
错误信息为空指针:
]] Root cause of ServletException.
java.lang.NullPointerException
at org.apache.struts2.views.jasperreports.JasperReportsResult.doExecute(JasperReportsResult.java:229)
at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178)
at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50)
Truncated. see log file for complete stacktrace
>
在 struts-jasperreport-plugin.jar 中 对应的行为:
227 ServletContext servletContext = (ServletContext) invocation.getInvocationContext().get (ServletActionContext.SERVLET_CONTEXT);
227 String systemId = servletContext.getRealPath(finalLocation);
228 Map parameters = new ValueStackShadowMap(stack);
229: File directory = new File(systemId.substring(0, systemId.lastIndexOf(File.separator)));
230 parameters.put("reportDirectory",directory);
231 parameters.put(JRParameter.REPORT_LOCALE, invocation.getInvocationContext().getLocale());