[xuxueli/xxl-job]2.2.0版本,自己新建的springboot依赖版本2.2.0后任务调度中心访问超时问题

2024-01-08 833 views
9

自己新建的一个springboot项目引入xxl-job2.2.0依赖包:在任务调度中心,执行定时任务后,一直报com.xxl.rpc.util.XxlRpcException: xxl-rpc, request timeout 缺少什么配置了。我本地的配置如下: xxl: job: admin: addresses: http://localhost:8081/xxl-job-admin executor:

执行器AppName [选填]:执行器心跳注册分组依据;为空则关闭自动注册
  appname: mytest
  # 执行器IP [选填]:默认为空表示自动获取IP,多网卡时可手动设置指定IP,该IP不会绑定Host仅作为通讯实用;地址信息用于 "执行器注册" 和 "调度中心请求并触发任务";
  ip: 192.168.0.110
  #执行器端口号 [选填]:小于等于0则自动获取;默认端口为9999,单机部署多个执行器时,注意要配置不同执行器端口;
  port: 9998
  # 执行器运行日志文件存储磁盘路径 [选填] :需要对该路径拥有读写权限;为空则使用默认路径;
  logpath: /data/applogs/xxl-job/jobhandler
  # 执行器日志保存天数 [选填] :值大于3时生效,启用执行器Log文件定期清理功能,否则不生效;
  logretentiondays: -1
# 执行器通讯TOKEN [选填]:非空时启用;
accessToken:

报错如下:

触发调度<<<<<<<<<<< 触发调度: address:http://192.168.0.110:9998/ code:500 msg:com.xxl.rpc.util.XxlRpcException: xxl-rpc, request timeout at:1588847780261, request:XxlRpcRequest{requestId='2d55c2d3-b242-4776-b485-bee740013dd4', createMillisTime=1588847776212, accessToken='', className='com.xxl.job.core.biz.ExecutorBiz', methodName='run', parameterTypes=[class com.xxl.job.core.biz.model.TriggerParam], parameters=[TriggerParam{jobId=1, executorHandler='myxxljob', executorParams='wm', executorBlockStrategy='SERIAL_EXECUTION', executorTimeout=0, logId=226, logDateTime=1588847776151, glueType='BEAN', glueSource='', glueUpdatetime=1541254891000, broadcastIndex=0, broadcastTotal=1}], version='null'} at com.xxl.rpc.remoting.net.params.XxlRpcFutureResponse.get(XxlRpcFutureResponse.java:117) at com.xxl.rpc.remoting.invoker.reference.XxlRpcReferenceBean$1.invoke(XxlRpcReferenceBean.java:242) at com.sun.proxy.$Proxy100.run(Unknown Source) at com.xxl.job.admin.core.trigger.XxlJobTrigger.runExecutor(XxlJobTrigger.java:178) at com.xxl.job.admin.core.trigger.XxlJobTrigger.processTrigger(XxlJobTrigger.java:136) at com.xxl.job.admin.core.trigger.XxlJobTrigger.trigger(XxlJobTrigger.java:67) at com.xxl.job.admin.core.thread.JobTriggerPoolHelper.lambda$addTrigger$2(JobTriggerPoolHelper.java:61) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

回答

8

调度中心不是2.2.0吧,2.2.0已经移除xxl-rpc了

7

调度中心是2.2.0的,xxl-rpc是1.5版,下载的源码可以正常使用,自己新建一个springboot工程就一直报超时的问题,看了admin这个服务报错是: 2020-05-08 08:44:45 xxl-job-executor-sample-spring [com.xxl.rpc.remoting.net.impl.netty_http.client.NettyHttpClientHandler]-[nioEventLoopGroup-2-1]-[exceptionCaught]-[62]-[ERROR] >>>>>>>>>>> xxl-rpc netty_http client caught exception com.xxl.rpc.util.XxlRpcException: com.caucho.hessian.io.HessianProtocolException: No classes defined at reference '64' at com.xxl.rpc.serialize.impl.HessianSerializer.deserialize(HessianSerializer.java:52) at com.xxl.rpc.remoting.net.impl.netty_http.client.NettyHttpClientHandler.channelRead0(NettyHttpClientHandler.java:52) at com.xxl.rpc.remoting.net.impl.netty_http.client.NettyHttpClientHandler.channelRead0(NettyHttpClientHandler.java:22) at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355) at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:321) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:295) at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355) at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Thread.java:745) Caused by: com.caucho.hessian.io.HessianProtocolException: No classes defined at reference '64' at com.caucho.hessian.io.Hessian2Input.error(Hessian2Input.java:2926) at com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:2118) at com.caucho.hessian.io.CollectionDeserializer.readLengthList(CollectionDeserializer.java:93) at com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:2088) at com.xxl.rpc.serialize.impl.HessianSerializer.deserialize(HessianSerializer.java:49) ... 34 more 2020-05-08 08:44:45 xxl-job-executor-sample-spring [com.xxl.rpc.remoting.invoker.reference.XxlRpcReferenceBean]-[xxl-job, admin JobTriggerPoolHelper-fastTriggerPool-1836601521]-[invoke]-[248]-[INFO] >>>>>>>>>>> xxl-rpc, invoke error, address:http://192.168.0.110:9997/, XxlRpcRequestXxlRpcRequest{requestId='d6a46994-ba6c-40fb-9357-aa4c26ca8dc4', createMillisTime=1588898666275, accessToken='', className='com.xxl.job.core.biz.ExecutorBiz', methodName='run', parameterTypes=[class com.xxl.job.core.biz.model.TriggerParam], parameters=[TriggerParam{jobId=3, executorHandler='mycenterjob', executorParams='wm', executorBlockStrategy='SERIAL_EXECUTION', executorTimeout=30000, logId=268, logDateTime=1588898666198, glueType='BEAN', glueSource='', glueUpdatetime=1588836346000, broadcastIndex=0, broadcastTotal=1}], version='null'} 2020-05-08 08:44:45 xxl-job-executor-sample-spring [com.xxl.job.admin.core.trigger.XxlJobTrigger]-[xxl-job, admin JobTriggerPoolHelper-fastTriggerPool-1836601521]-[runExecutor]-[180]-[ERROR] >>>>>>>>>>> xxl-job trigger error, please check if the executor[http://192.168.0.110:9997/] is running. com.xxl.rpc.util.XxlRpcException: xxl-rpc, request timeout at:1588898684857, request:XxlRpcRequest{requestId='d6a46994-ba6c-40fb-9357-aa4c26ca8dc4', createMillisTime=1588898666275, accessToken='', className='com.xxl.job.core.biz.ExecutorBiz', methodName='run', parameterTypes=[class com.xxl.job.core.biz.model.TriggerParam], parameters=[TriggerParam{jobId=3, executorHandler='mycenterjob', executorParams='wm', executorBlockStrategy='SERIAL_EXECUTION', executorTimeout=30000, logId=268, logDateTime=1588898666198, glueType='BEAN', glueSource='', glueUpdatetime=1588836346000, broadcastIndex=0, broadcastTotal=1}], version='null'} at com.xxl.rpc.remoting.net.params.XxlRpcFutureResponse.get(XxlRpcFutureResponse.java:117) at com.xxl.rpc.remoting.invoker.reference.XxlRpcReferenceBean$1.invoke(XxlRpcReferenceBean.java:242) at com.sun.proxy.$Proxy99.run(Unknown Source) at com.xxl.job.admin.core.trigger.XxlJobTrigger.runExecutor(XxlJobTrigger.java:178) at com.xxl.job.admin.core.trigger.XxlJobTrigger.processTrigger(XxlJobTrigger.java:136) at com.xxl.job.admin.core.trigger.XxlJobTrigger.trigger(XxlJobTrigger.java:67) at com.xxl.job.admin.core.thread.JobTriggerPoolHelper.lambda$addTrigger$2(JobTriggerPoolHelper.java:61) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

2

执行器的IP、port配了没有,通不通

3

问题解决了,2.2.0的本版应该有bug,换成2.2.1的本版后问题就解决了

9

出2.2.1版本了?我咋没看到?

4

你看现在的服务端源码里面pom文件里面:

com.xuxueli
<artifactId>xxl-job</artifactId>
<version>2.2.1-SNAPSHOT</version>
<packaging>pom</packaging>
4

执行器这些用下载的源码的springboot项目2.2.0是可以正常访问的,但是自己新建一个springboot工程2.2.0是访问不了的,用现在的服务端版本2.2.1就可以了。

5

mark 相同问题 1.git拉出代码,使用2.2.0tag,启动admin 与 executor 2.然后配置一个httpJobHandler 随便扔个百度的get请求, 其他按照文档配 3.点击执行一次,日志能看到成功,启动调度器,发现日志里面全部是失败,看明细说明是:500 com.xxl.rpc.util.XxlRpcException: xxl-rpc, request timeout

7

切换到2.1.2正常了...