import org.apache.logging.log4j.Level; import org.apache.logging.log4j.core.impl.Log4jLogEvent; import org.apache.logging.log4j.core.layout.PatternLayout; import org.apache.logging.log4j.message.SimpleMessage; /** * Created by lanhuajian on 2017/3/29…
错误信息: nested exception is java.lang.IllegalStateException: It is illegal to call this method if the current request is not in asynchronous mode (i.e. isAsyncStarted() returns false)] with root cause:错误原因: joinPoint.getArgs()返回的数组中携带有Request(HttpServl…
之前在使用自定义线程池异步执行耗时任务时,一直记着如果业务方法抛出异常没有捕获,那么是看不到日志框架输出的异常日志的,所以总是在业务方法中包裹一层try-catch捕获可能发生的异常.也未去深入为什么没有打印异常日志和解决方法,这里记录下自己的总结. 1.事例 @Slf4j @SpringBootTest @RunWith(SpringRunner.class) public class ThreadPoolExecutorTest { //这里直接使用ThreadPoolExecutor类,这…