使用 openJDK 11 的 jenkins 中的嵌入式 Mongo flapdoodle 问题

问题描述 投票:0回答:1

将 java 从 8 迁移到 11 时,jenkins Linux 服务器中的所有 junit mongo 查询都失败了。

Error. - -11:06:20.987 [main] WARN de.flapdoodle.embed.mongo.packageresolver.linux.LinuxPackageFinder - because there is no package for PRODUCTION:Platform{operatingSystem=Linux, architecture=X86_64} we fall back to PRODUCTION:Platform{operatingSystem=Linux, architecture=X86_64, version=Ubuntu_20_04}
09:36:21  11:06:21.031 [main] WARN 0% 1% 2% 3% 4% 5% 6% 7% 8% 9% 10% 11% 12% 13% 14% 15% 16% 17% 18% 19% 20% 21% 22% 23% 24% 25% 26% 27% 28% 29% 30% 31% 32% 33% 34% 35% 36% 37% 38% 39% 40% 41% 42% 43% 44% 45% 46% 47% 48% 49% 50% 51% 52% 53% 54% 55% 56% 57% 58% 59% 60% 61% 62% 63% 64% 65% 66% 67% 68% 69% 70% 71% 72% 73% 74% 75% 76% 77% 78% 79% 80% 81% 82% 83% 84% 85% 86% 87% 88% 89% 90% 91% 92% 93% 94% 95% 96% 97% 98% 99% 100% Download PRODUCTION:Platform{operatingSystem=Linux, architecture=X86_64} downloaded with 70794kb/s
09:36:21  Download PRODUCTION:Platform{operatingSystem=Linux, architecture=X86_64} DONE
09:36:21  11:06:20.987 [main] WARN de.flapdoodle.embed.mongo.packageresolver.linux.LinuxPackageFinder - because there is no package for PRODUCTION:Platform{operatingSystem=Linux, architecture=X86_64} we fall back to PRODUCTION:Platform{operatingSystem=Linux, architecture=X86_64, version=Ubuntu_20_04}
09:36:21  11:06:21.031 [main] WARN 

09:36:21  Extract /root/.embedmongo/linux/mongodb-linux-x86_64-ubuntu2004-4.4.17.tgz START
09:36:22  Extract /root/.embedmongo/linux/mongodb-linux-x86_64-ubuntu2004-4.4.17.tgz extract mongodb-linux-x86_64-ubuntu2004-4.4.17/bin/mongod
09:36:22  Extract /root/.embedmongo/linux/mongodb-linux-x86_64-ubuntu2004-4.4.17.tgz nothing left
09:36:22  Extract /root/.embedmongo/linux/mongodb-linux-x86_64-ubuntu2004-4.4.17.tgz DONE
09:36:22  
09:36:22  [mongod error]Error loading shared library libresolv.so.2: No such file or directory (needed by /tmp/extract-0b7e7b7a-a382-44e4-9742-b79b138cb3c1extractmongod)
09:36:22  [mongod error] Error relocating /tmp/../lib/ld-linux-x86-64.so.2: unsupported relocation type 37
09:36:22  [mongod error] Error relocating /tmp/extract-0b7e7b7a-a382-44e4-9742-b79b138cb3c1extractmongod: __snprintf_chk: symbol not found
09:36:22  [mongod error] Error relocating /tmp/extract-0b7e7b7a-a382-44e4-9742-b79b138cb3c1extractmongod: __memcpy_chk: symbol not found
09:36:22  [mongod error] Error relocating /tmp/extract-0b7e7b7a-a382-44e4-9742-
09:36:22  [mongod error] 
09:36:44  Exception java.lang.RuntimeException: Could not start process: 
09:36:44  ----------------------
09:36:44  Hmm.. no failure message.. 
09:36:44  ...the cause must be somewhere in the process output
09:36:44  ----------------------
09:36:44  
09:36:44

以前我使用 flapdoodle 2.0.0 和 jdk 8,它在本地和 jenkins 中工作。但是我已经将 java 8 迁移到 11 和 flapdoodle 3.5.4 它在本地工作但遇到了 jenkins 问题。

spring-boot jenkins junit java-11 flapdoodle-embed-mongo
1个回答
0
投票

面临同样的问题。 看起来路径和版本不匹配。 您为嵌入式 mongo 构建器提供的版本作为“生产”已弃用。在提到的包路径中没有这样的包可用。

调试了几天,找不到任何解决办法。但是找到了一个不同的库,它可以顺利地用于上述配置。

将以下依赖项添加到您的 pom 文件中:

<dependency>  <groupId>de.bwaldvogel</groupId>  <artifactId>mongo-java-server</artifactId>  <version>1.34.0</version>  <scope>test</scope></dependency>

根据需要更改测试配置文件。 它应该工作顺利。

© www.soinside.com 2019 - 2024. All rights reserved.