起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 3179|回复: 1

[结贴] getInputStream() has already been called是什么错误

[复制链接]

12

主题

23

帖子

95

积分

初级会员

Rank: 2

积分
95
QQ
发表于 2020-6-24 15:20:54 | 显示全部楼层 |阅读模式
本帖最后由 lch_245298 于 2020-6-24 15:54 编辑

调用后台请求的时候报如下错误,貌似和JSON序列化有关?对同一个对象调用了两次getReader?JSON对象是从前台传到后台直接调用序列化的
2020-06-24 15:17:41 Action[logistics/user/adduser]执行失败,getInputStream() has already been called for this request
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at com.justep.baas.action.Engine.execAction(Unknown Source)
        at com.justep.baas.action.Engine.execAction(Unknown Source)
        at com.justep.baas.servlet.BaasServlet.execService(Unknown Source)
        at com.justep.baas.servlet.BaasServlet.service(Unknown Source)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        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.Http11Processor.process(Http11Processor.java:861)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: getInputStream() has already been called for this request
        at org.apache.catalina.connector.Request.getReader(Request.java:1191)
        at org.apache.catalina.connector.RequestFacade.getReader(RequestFacade.java:470)
        at Serializer_1.write1(Unknown Source)
        at Serializer_1.write(Unknown Source)
        at com.alibaba.fastjson.serializer.MapSerializer.write(MapSerializer.java:169)
        at com.alibaba.fastjson.serializer.JSONSerializer.write(JSONSerializer.java:367)
        at com.alibaba.fastjson.JSON.toJSONString(JSON.java:556)
        at logistics.HttpClient4.doPost(HttpClient4.java:44)
        at logistics.user.addUser(user.java:93)
        at logistics.User__do.adduser(User__do.java:107)
        ... 20 more
2020-06-24 15:17:41 Action[logistics/user/adduser]执行失败,getInputStream() has already been called for this request
com.justep.baas.action.ActionException: Action[logistics/user/adduser]执行失败,getInputStream() has already been called for this request
        at com.justep.baas.action.Engine.execAction(Unknown Source)
        at com.justep.baas.action.Engine.execAction(Unknown Source)
        at com.justep.baas.servlet.BaasServlet.execService(Unknown Source)
        at com.justep.baas.servlet.BaasServlet.service(Unknown Source)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        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.Http11Processor.process(Http11Processor.java:861)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:745)
六月 24, 2020 3:17:41 下午 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet WeX5_Baas_Servlet threw exception
com.justep.baas.action.ActionException: Action[logistics/user/adduser]执行失败,getInputStream() has already been called for this request
        at com.justep.baas.action.Engine.execAction(Unknown Source)
        at com.justep.baas.action.Engine.execAction(Unknown Source)
        at com.justep.baas.servlet.BaasServlet.execService(Unknown Source)
        at com.justep.baas.servlet.BaasServlet.service(Unknown Source)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        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.Http11Processor.process(Http11Processor.java:861)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:745)

12

主题

23

帖子

95

积分

初级会员

Rank: 2

积分
95
QQ
 楼主| 发表于 2020-6-24 17:16:27 | 显示全部楼层
本帖最后由 lch_245298 于 2020-6-26 07:58 编辑

貌似找到原因了,前台传到后台的参数 JSON对象里边有两个请求对象:response和request ,所以不能对它直接序列化。需要把这两个参数移除才行。结帖
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2024-11-28 13:37 , Processed in 0.056780 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表