yulichang / mybatis-plus-join

支持连表查询的mybatis-plus,mybatis-plus风格的连表操作提供wrapper.leftJoin(),wrapper.rightJoin()等操作
https://mybatis-plus-join.github.io
Apache License 2.0
1.16k stars 126 forks source link

MPJLambdaWrapper clone的时候会报序列化失败的错误 #169

Closed liu-52 closed 1 month ago

liu-52 commented 2 months ago

当前使用版本(必填,否则不予处理)

1.4.13

该问题是如何引起的?(确定最新版也有问题再提!!!)

MPJLambdaWrapper clone的时候报错

重现步骤(如果有就写完整)

MPJLambdaWrapper wrapper = new MPJLambdaWrapper<>(); MPJLambdaWrapper wrapper1 = wrapper.clone();

clone 的时候会报错 序列化失败

报错信息

java.lang.IllegalArgumentException: Failed to serialize object of type: class com.github.yulichang.wrapper.MPJLambdaWrapper at com.baomidou.mybatisplus.core.toolkit.SerializationUtils.serialize(SerializationUtils.java:64) at com.baomidou.mybatisplus.core.toolkit.SerializationUtils.clone(SerializationUtils.java:45) at com.github.yulichang.wrapper.JoinAbstractWrapper.clone(JoinAbstractWrapper.java:920) at com.lenovo.prm.base.service.ChannelSalesDashboardService.dashboardFilter(ChannelSalesDashboardService.java:289) at com.lenovo.prm.base.controller.ChannelSalesDashboardController.developmentFilter(ChannelSalesDashboardController.java:36) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:118) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:884) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1081) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:974) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:914) at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:590) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885) at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:205) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at com.lenovo.dxp.realm.log.LogFilter.doFilter(LogFilter.java:26) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at org.springframework.web.filter.ServerHttpObservationFilter.doFilterInternal(ServerHttpObservationFilter.java:109) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:340) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:391) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:896) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1744) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.base/java.lang.Thread.run(Thread.java:1583) Caused by: java.io.NotSerializableException: com.github.yulichang.autoconfigure.MybatisPlusJoinAutoConfiguration$$Lambda/0x0000029604c6c8f8 at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1200) at java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1585) at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1542) at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1451) at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1194) at java.base/java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:358) at java.base/java.util.ArrayList.writeObject(ArrayList.java:948) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at java.base/java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1072) at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1529) at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1451) at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1194) at java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1585) at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1542) at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1451) at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1194) at java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1585) at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1542) at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1451) at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1194) at java.base/java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:358) at java.base/java.util.ArrayList.writeObject(ArrayList.java:948) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at java.base/java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1072) at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1529) at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1451) at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1194) at java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1585) at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1542) at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1451) at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1194) at java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1585) at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1542) at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1451) at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1194) at java.base/java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:358) at com.baomidou.mybatisplus.core.toolkit.SerializationUtils.serialize(SerializationUtils.java:61) ... 59 common frames omitted

yulichang commented 1 month ago

升级版本