我正在嘗試在 Google Cloud Dataflow 上部署一個(gè)簡(jiǎn)單的管道(將一些數(shù)據(jù)從 PubSub 復(fù)制到 Bigtable),但我不斷收到以下錯(cuò)誤: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這個(gè)錯(cuò)誤會(huì)殺死工人。即使我的代碼中沒(méi)有日志記錄語(yǔ)句或?qū)?,并且?shí)際上堆棧跟蹤中沒(méi)有引用我的代碼,也會(huì)發(fā)生這種情況。我很熟悉這個(gè)問(wèn)題,我可以看到(在 GCP Stackdriver 中)我的 Java命令確實(shí) 包含: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: ...問(wèn)題是這個(gè) Java 命令是由谷歌創(chuàng)建的。不在log4j_to_slf4j.jar我自己的依賴項(xiàng)中。如何編輯此命令并將其從類路徑中刪除?或者有更好的解決方案嗎?
1 回答

蝴蝶刀刀
TA貢獻(xiàn)1801條經(jīng)驗(yàn) 獲得超8個(gè)贊
好的,所以降級(jí)這些依賴項(xiàng):
<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解決了這個(gè)問(wèn)題。它再次失敗2.10.0。我在官方(?)示例上對(duì)我的實(shí)現(xiàn)進(jìn)行建模,但是,這些示例使用2.4.0.
添加回答
舉報(bào)
0/150
提交
取消