我正在尝试在 Google Cloud Dataflow 上部署一个简单的管道(将一些数据从 PubSub 复制到 Bigtable),但我不断收到以下错误:Exception in thread "main" java.lang.StackOverflowError at java.util.HashMap.hash(HashMap.java:338) at java.util.HashMap.get(HashMap.java:556) at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:67) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)[ multiple times ... ] at org.apache.log4j.Category.<init>(Category.java:57) at org.apache.log4j.Logger.<init>(Logger.java:37) at org.apache.log4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:43) at org.apache.log4j.LogManager.getLogger(LogManager.java:45) at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:73) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)java failed with exit status 1这个错误会杀死工人。即使我的代码中没有日志记录语句或导入,并且实际上堆栈跟踪中没有引用我的代码,也会发生这种情况。我很熟悉这个问题,我可以看到(在 GCP Stackdriver 中)我的 Java命令确实 包含:log4j_to_slf4j.jarjava -Xmx5834483752 -XX:-OmitStackTraceInFastThrow -Xloggc:/var/log/dataflow/jvm-gc.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=2 -XX:GCLogFileSize=512K -cp /opt/google/dataflow/streaming/libWindmillServer.jar:/opt/google/dataflow/streaming/dataflow-worker.jar:/opt/google/dataflow/slf4j/jcl_over_slf4j.jar:/opt/google/dataflow/slf4j/log4j_over_slf4j.jar:/opt/google/dataflow/slf4j/log4j_to_slf4j.jar: ...问题是这个 Java 命令是由谷歌创建的。不在log4j_to_slf4j.jar我自己的依赖项中。如何编辑此命令并将其从类路径中删除?或者有更好的解决方案吗?
1 回答
蝴蝶刀刀
TA贡献1801条经验 获得超8个赞
好的,所以降级这些依赖项:
<dependency>
<groupId>org.apache.beam</groupId>
<artifactId>beam-runners-google-cloud-dataflow-java</artifactId>
<version>2.12.0</version>
</dependency>
<dependency>
<groupId>org.apache.beam</groupId>
<artifactId>beam-sdks-java-extensions-json-jackson</artifactId>
<version>2.12.0</version>
</dependency>
从2.12.0到2.9.0解决了这个问题。它再次失败2.10.0。我在官方(?)示例上对我的实现进行建模,但是,这些示例使用2.4.0.
添加回答
举报
0/150
提交
取消