dromara / hutool

🍬A set of tools that keep Java sweet.
https://hutool.cn
Other
29.25k stars 7.54k forks source link

No ConfigurableListableBeanFactory or ApplicationContext injected, maybe not in the Spring environment? #3769

Closed pikachu011 closed 1 month ago

pikachu011 commented 1 month ago

版本情况

JDK版本: jdk17 hutool版本: 5.8.26 flink 1.19.1

问题描述(包括截图)

这是在远程flink上执行报错了,flink本地执行时正常的,远程执行flink任务报错了,

cn.hutool.core.exceptions.UtilException: No ConfigurableListableBeanFactory or ApplicationContext injected, maybe not in the Spring environment? at cn.hutool.extra.spring.SpringUtil.getBeanFactory(SpringUtil.java:76) at cn.hutool.extra.spring.SpringUtil.getBean(SpringUtil.java:122) at com.iov.vboss.filter.analysis.flink.CdrFlatMapFunction.open(CdrFlatMapFunction.java:74) at org.apache.flink.api.common.functions.util.FunctionUtils.openFunction(FunctionUtils.java:34) at org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.open(AbstractUdfStreamOperator.java:102) at org.apache.flink.streaming.api.operators.StreamFlatMap.open(StreamFlatMap.java:40) at org.apache.flink.streaming.runtime.tasks.RegularOperatorChain.initializeStateAndOpenOperators(RegularOperatorChain.java:107) at org.apache.flink.streaming.runtime.tasks.StreamTask.restoreStateAndGates(StreamTask.java:799) at org.apache.flink.streaming.runtime.tasks.StreamTask.lambda$restoreInternal$3(StreamTask.java:753) at org.apache.flink.streaming.runtime.tasks.StreamTaskActionExecutor$1.call(StreamTaskActionExecutor.java:55) at org.apache.flink.streaming.runtime.tasks.StreamTask.restoreInternal(StreamTask.java:753) at org.apache.flink.streaming.runtime.tasks.StreamTask.restore(StreamTask.java:712) at org.apache.flink.runtime.taskmanager.Task.runWithSystemExitMonitoring(Task.java:958) at org.apache.flink.runtime.taskmanager.Task.restoreAndInvoke(Task.java:927) at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:751) at org.apache.flink.runtime.taskmanager.Task.run(Task.java:566) at java.base/java.lang.Thread.run(Unknown Source)

  1. 复现代码 image
Console.log("报错了");
  1. 堆栈信息

  2. 测试涉及到的文件(注意脱密)

比如报错的Excel文件,有问题的图片等。

looly commented 1 month ago

看下cause by。

目测是线上环境缺包,没有加载bean导致的?