Code Monkey home page Code Monkey logo

Comments (10)

CxcPDF avatar CxcPDF commented on September 24, 2024

超时就是我上一个issue中提到的问题

from blog-vue-springboot.

wenlou avatar wenlou commented on September 24, 2024

超时就是我上一个issue中提到的问题

改成你提的

//请求的参数
Object[] args = joinPoint.getArgs();
if(args.length>0) {
String params = JSON.toJSONString(args[0]);
log.setParams(params);
}
依然不行,不能注册,一刷新就疯狂的报连接超时

from blog-vue-springboot.

CxcPDF avatar CxcPDF commented on September 24, 2024

个人感觉应该是前端代码有问题,导致了前端不断地向后端发送请求。具体的错误在哪还得作者来告诉我们

from blog-vue-springboot.

CxcPDF avatar CxcPDF commented on September 24, 2024
   //请求的参数
    Object[] arguments = joinPoint.getArgs();
    Object[] args = new Object[arguments.length];
    for (int i = 0; i < arguments.length; i++) {
        if (arguments[i] instanceof ServletRequest || arguments[i] instanceof ServletResponse || arguments[i] instanceof MultipartFile) {
            //ServletRequest不能序列化,从入参里排除,否则报异常:java.lang.IllegalStateException: It is illegal to call this method if the current request is not in asynchronous mode (i.e. isAsyncStarted() returns false)
            //ServletResponse不能序列化 从入参里排除,否则报异常:java.lang.IllegalStateException: getOutputStream() has already been called for this response
            continue;
        }
        args[i] = arguments[i];
    }
    if(args.length>0) {
        String params = JSON.toJSONString(args[0]);
        log.setParams(params);
    }

把代码改成这样就行了,因为参数里面有HttpRequest的东西,这个是不能被序列化的,所以就会报错

from blog-vue-springboot.

CxcPDF avatar CxcPDF commented on September 24, 2024

超时就是我上一个issue中提到的问题

改成你提的

//请求的参数
Object[] args = joinPoint.getArgs();
if(args.length>0) {
String params = JSON.toJSONString(args[0]);
log.setParams(params);
}
依然不行,不能注册,一刷新就疯狂的报连接超时

//请求的参数
Object[] arguments = joinPoint.getArgs();
Object[] args = new Object[arguments.length];
for (int i = 0; i < arguments.length; i++) {
if (arguments[i] instanceof ServletRequest || arguments[i] instanceof ServletResponse || arguments[i] instanceof MultipartFile) {
//ServletRequest不能序列化,从入参里排除,否则报异常:java.lang.IllegalStateException: It is illegal to call this method if the current request is not in asynchronous mode (i.e. isAsyncStarted() returns false)
//ServletResponse不能序列化 从入参里排除,否则报异常:java.lang.IllegalStateException: getOutputStream() has already been called for this response
continue;
}
args[i] = arguments[i];
}
if(args.length>0) {
String params = JSON.toJSONString(args[0]);
log.setParams(params);
}
把代码改成这样就行了,因为参数里面有HttpRequest的东西,这个是不能被序列化的,所以就会报错

from blog-vue-springboot.

shimh-develop avatar shimh-develop commented on September 24, 2024

超时就是我上一个issue中提到的问题

改成你提的
//请求的参数
Object[] args = joinPoint.getArgs();
if(args.length>0) {
String params = JSON.toJSONString(args[0]);
log.setParams(params);
}
依然不行,不能注册,一刷新就疯狂的报连接超时

//请求的参数
Object[] arguments = joinPoint.getArgs();
Object[] args = new Object[arguments.length];
for (int i = 0; i < arguments.length; i++) {
if (arguments[i] instanceof ServletRequest || arguments[i] instanceof ServletResponse || arguments[i] instanceof MultipartFile) {
//ServletRequest不能序列化,从入参里排除,否则报异常:java.lang.IllegalStateException: It is illegal to call this method if the current request is not in asynchronous mode (i.e. isAsyncStarted() returns false)
//ServletResponse不能序列化 从入参里排除,否则报异常:java.lang.IllegalStateException: getOutputStream() has already been called for this response
continue;
}
args[i] = arguments[i];
}
if(args.length>0) {
String params = JSON.toJSONString(args[0]);
log.setParams(params);
}
把代码改成这样就行了,因为参数里面有HttpRequest的东西,这个是不能被序列化的,所以就会报错

是 写日志时带上访问的参数,这里没有细看,可以注释掉或改一下逻辑

from blog-vue-springboot.

gl01108023 avatar gl01108023 commented on September 24, 2024

屏蔽掉了还是报连接超时

from blog-vue-springboot.

shimh-develop avatar shimh-develop commented on September 24, 2024

屏蔽掉了还是报连接超时
@gl01108023
可以跟下代码 找下具体问题

from blog-vue-springboot.

Viserion-nlper avatar Viserion-nlper commented on September 24, 2024

我也是这个错误 能解决一下吗

from blog-vue-springboot.

meteorOSS avatar meteorOSS commented on September 24, 2024

我也出现这个错误了,看了一下是因为默认导入的数据里文章的userid是1,而不存在1这个user。注册一个账号,把文章表里的user_id字段改成你刚注册的就行了

from blog-vue-springboot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.