[xuxueli/xxl-job]1.9.2升级问题,没有做客户端向下兼容

2024-05-15 982 views
2

从1.9.1往1.9.2升级时客户端不兼容,1.9.1的客户端向1.9.2调度系统注册不上,因为微服务架构涉及的项目比较多,这样生成系统升级很难做, 大概是因为1.9.2修改了 HessianSerializer这个类,整个升级搞的让人吐血,下次发版本建议考虑一下升级问题

 xxl-job-admin [com.xxl.job.admin.controller.JobApiController]-[http-nio-8080-exec-4]-[doInvoke]-[42]-[ERROR] expected integer at 0x74
 java.lang.IllegalStateException: expected integer at 0x74
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609300439Z  at com.xxl.job.core.rpc.serialize.HessianSerializer.deserialize(HessianSerializer.java:47)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609304283Z  at com.xxl.job.admin.controller.JobApiController.doInvoke(JobApiController.java:36)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609307497Z  at com.xxl.job.admin.controller.JobApiController.api(JobApiController.java:55)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609311478Z  at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609316006Z  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609320417Z  at java.lang.reflect.Method.invoke(Method.java:498)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609324429Z  at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609328848Z  at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609332978Z  at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609337458Z  at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:849)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609342223Z  at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:760)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609346851Z  at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609351200Z  at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609355665Z  at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609359963Z  at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609364319Z  at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609369262Z  at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609373646Z  at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609377977Z  at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609385059Z  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609390524Z  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609394759Z  at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609399118Z  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609403294Z  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609425667Z  at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609429960Z  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609432862Z  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609435690Z  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609438467Z  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609441114Z  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609443859Z  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609446513Z  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609449211Z  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609451845Z  at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609454601Z  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609457272Z  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609459991Z  at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609463262Z  at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609466285Z  at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609468922Z  at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1468)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609471641Z  at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609475588Z  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609478409Z  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609481195Z  at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609483929Z  at java.lang.Thread.run(Thread.java:748)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609486485Z Caused by: com.caucho.hessian.io.HessianProtocolException: expected integer at 0x74
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609489205Z  at com.caucho.hessian.io.Hessian2Input.error(Hessian2Input.java:2943)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609491827Z  at com.caucho.hessian.io.Hessian2Input.expect(Hessian2Input.java:2891)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609494539Z  at com.caucho.hessian.io.Hessian2Input.readInt(Hessian2Input.java:825)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609498141Z  at com.caucho.hessian.io.Hessian2Input.readType(Hessian2Input.java:2438)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609505923Z  at com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:2115)
taskadmin_taskadmin_1 | 2018-10-12T09:22:27.609519091Z  at com.xxl.job.core.rpc.serialize.HessianSerializer.deserialize(HessianSerializer.java:44)

回答

4

1.9.1的客户端 和1.9.2 的客户端不是一样的么

1

如果要改执行器,要怎么改呢

1

如果要改执行器,要怎么改呢

把1.9.1 的HessianSerializer这个类,替换掉1.9.2的, 这样1.9.1的客户端就可以注册到1.9.2,但1.9.2的客户端又注册不上去了,这个不建议自己改,只能让作者重新发版本了

4

我改了下,你改父项目的xxl-job-core 的版本号就可以了,修改为 1.9.2 句没问题了

3

全部项目调度中心,执行器都用 1.9.2 版本的

1

@idealspark @zenghuabin 你好,v1.9.2 序列化逻辑进行优化升级,如需升级需要调度中心与执行器一同升级、保持一致的啊。