MyException - 我的异常网
当前位置:我的异常网» Java Web开发 » java.lang.NumberFormatException: For input strin

java.lang.NumberFormatException: For input string: ""(2)

www.MyException.Cn  网友分享于:2013-11-10  浏览:1604次

------解决方案--------------------
调用logger.info(getTrace(e));就可以了
Java code
public String getTrace(Throwable t) {
        StringWriter stringWriter= new StringWriter();
        PrintWriter writer= new PrintWriter(stringWriter);
        t.printStackTrace(writer);
        StringBuffer buffer= stringWriter.getBuffer();
        return buffer.toString();
    }

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有