Skip to content

controller方法参数列表中带有HttpServletRequest类型参数,执行完成后,保存日志报错 #1394

Closed
@qingjing0606

Description

@qingjing0606
版本号:2.2.0
问题描述:controller中方法加入HttpServletRequest参数,执行完成后保存日志时,抛异常,需过滤掉HttpServletRequest或HttpServletResponse参数
截图&代码:

image

java.lang.IllegalStateException: It is illegal to call this method if the current request is not in asynchronous mode (i.e. isAsyncStarted() returns false)
at org.apache.catalina.connector.Request.getAsyncContext(Request.java:1758)
at org.apache.catalina.connector.RequestFacade.getAsyncContext(RequestFacade.java:1068)
at javax.servlet.ServletRequestWrapper.getAsyncContext(ServletRequestWrapper.java:435)
at com.alibaba.fastjson.serializer.ASMSerializer_2_ShiroHttpServletRequest.write(Unknown Source)
at com.alibaba.fastjson.serializer.JSONSerializer.writeWithFieldName(JSONSerializer.java:333)
at com.alibaba.fastjson.serializer.JSONSerializer.writeWithFieldName(JSONSerializer.java:311)
at com.alibaba.fastjson.serializer.ObjectArrayCodec.write(ObjectArrayCodec.java:118)
at com.alibaba.fastjson.serializer.JSONSerializer.write(JSONSerializer.java:285)
at com.alibaba.fastjson.JSON.toJSONString(JSON.java:745)
at com.alibaba.fastjson.JSON.toJSONString(JSON.java:683)
at com.alibaba.fastjson.JSON.toJSONString(JSON.java:648)
at org.jeecg.modules.system.aspect.AutoLogAspect.getReqestParams(AutoLogAspect.java:147)
at org.jeecg.modules.system.aspect.AutoLogAspect.saveSysLog(AutoLogAspect.java:88)

src/main/java/org/jeecg/modules/system/aspect/AutoLogAspect.java
image

友情提示: 未按格式要求发帖,会直接删掉。

Activity

zhangdaiscott

zhangdaiscott commented on Jul 10, 2020

@zhangdaiscott
Member

待测试

1298191366

1298191366 commented on Jul 14, 2020

@1298191366
Contributor

新版本已修改

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @zhangdaiscott@qingjing0606@1298191366

        Issue actions

          controller方法参数列表中带有HttpServletRequest类型参数,执行完成后,保存日志报错 · Issue #1394 · jeecgboot/JeecgBoot