`
Lstoryc
  • 浏览: 78216 次
文章分类
社区版块
存档分类
最新评论

Servlet.service() for servlet default threw exception

 
阅读更多
2014-4-8 11:31:32 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet default threw exception
java.lang.IllegalStateException
	at org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:407)
	at org.apache.struts2.dispatcher.Dispatcher.sendError(Dispatcher.java:770)
	at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:505)
	at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
	at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:879)
	at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:617)
	at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1774)
	at java.lang.Thread.run(Thread.java:662)

 

后台代码:

public String downloadKeyPairCSR()
    {
	    PrintWriter out = null;
        try {        
            byte[] byteCSR = session.get("CSR_KEYPAIR");
            servletResponse = ServletActionContext.getResponse();
            servletResponse.setContentType("application/octet-stream");
            servletResponse.setCharacterEncoding("UTF-8");
            out = servletResponse.getWriter();
            servletResponse.setHeader("content-disposition", "attachment; filename=\""
                    + ParamConst.FILENAME_USERDB_CONFIG + "\"");
            out.append(byteCSR.toString());
            out.close();
            //return null;

            /*adminLogService.logAdminActivity(userName == null ? null : userName, null,
                    ParamConst.MENUS_CERTIFICATE_INFO, ParamConst.ACT_DCSR, ParamConst.SUCCESS,
                    ExceptionMessage.CERT_CREATE_DCSR_SUCCESS, logDTO);*/
        }
        catch (Exception e) {
            /*adminLogService.logAdminActivity(userName == null ? null : userName, null,
                    ParamConst.MENUS_CERTIFICATE_INFO, ParamConst.ACT_DCSR, ParamConst.FAILURE, e.getMessage(), logDTO);*/
            return this.submitException(e);
        }
        return SUCCESS;
    }

 

解决办法: 不能放回 SUCCESS, 返回 null 即可,原因待测。。。

 

 

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics