xxl-job icon indicating copy to clipboard operation
xxl-job copied to clipboard

在k8s中启动job executor 报错

Open yigubigu opened this issue 3 years ago • 4 comments

Please answer some questions before submitting your issue. Thanks!

应该不是代码的问题,我在本地是可以支持启动

Which version of XXL-JOB do you using?

最新的master 分支

Expected behavior

可以正常启动

Actual behavior

15:46:17.765 logback [main] ERROR o.s.boot.SpringApplication - Application run failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'xxlJobConfig': Unsatisfied dependency expressed through field 'port'; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'int'; nested exception is java.lang.NumberFormatException: For input string: "tcp://172.16.255.72:8081" at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:660) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPos

Steps to reproduce the behavior

apiVersion: v1 kind: Service metadata: name: xxl-job-executor namespace: xxl-job spec: externalTrafficPolicy: Cluster ports:

  • name: 8080-8081-tcp port: 8081 protocol: TCP targetPort: 8081
  • name: 9999-9999-tcp port: 9999 protocol: TCP targetPort: 9999
    selector: k8s-app: xxl-job-executor type: NodePort status: loadBalancer: {}

Other information

yigubigu avatar Jan 17 '22 08:01 yigubigu

与是否有service 没有关系,去除service,系统依旧报错。

yigubigu avatar Jan 18 '22 04:01 yigubigu

Failed to convert value of type 'java.lang.String' to required type 'int'; nested exception is java.lang.NumberFormatException: For input string: "tcp://172.16.255.72:8081"

lang2hong avatar Jan 19 '22 01:01 lang2hong

我的也是这个报错

artemus717 avatar Jun 16 '22 08:06 artemus717

XXL_JOB_EXECUTOR_PORT

artemus717 avatar Jun 16 '22 08:06 artemus717

大佬们,有解决方案吗

panxinnn avatar Mar 08 '23 02:03 panxinnn

大佬们,有解决方案吗

我发现是那个xxl.job.executor.port配置被k8s意外重写了,@Value注入时使用自定义的port配置可以读取正常

panxinnn avatar Mar 08 '23 06:03 panxinnn