xxl-job
xxl-job copied to clipboard
在k8s中启动job executor 报错
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
与是否有service 没有关系,去除service,系统依旧报错。
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"
我的也是这个报错
XXL_JOB_EXECUTOR_PORT
大佬们,有解决方案吗
大佬们,有解决方案吗
我发现是那个xxl.job.executor.port配置被k8s意外重写了,@Value注入时使用自定义的port配置可以读取正常