在 Heroku 工作节点上启动 Spring Shell 时出现 NullPointerException

发布于 2025-01-11 14:09:42 字数 3121 浏览 0 评论 0原文

最近我们面临一个问题,我们无法再在 Heroku 工作节点上启动 Spring Shell 应用程序。 shell 应用程序启动后,控制台立即打印 java.lang.NullPointerException 一百万次(就像有一个循环试图实例化一个 bean 或始终失败的东西)。

以下是摘录:

Running /env.sh java -jar ops.jar on ⬢ foo... up, worker.8633 (Standard-1X)

2022-03-04 07:44:37.221  INFO 5 --- [           main] ...Application        : Starting Application v1.0.0-SNAPSHOT using Java 11.0.11 on 2e0b87b1-cecd-4720-8c27-4d39afba9615 with PID 5 (/ops.jar started by u27375 in /)
2022-03-04 07:44:37.226  INFO 5 --- [           main] ...Application        : No active profile set, falling back to 1 default profile: "default"
2022-03-04 07:44:38.012  INFO 5 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2022-03-04 07:44:38.129  INFO 5 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 110 ms. Found 10 JPA repository interfaces.
2022-03-04 07:44:38.886  INFO 5 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
2022-03-04 07:44:38.948  INFO 5 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 5.6.5.Final
2022-03-04 07:44:39.127  INFO 5 --- [           main] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2022-03-04 07:44:39.547  INFO 5 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2022-03-04 07:44:39.929  INFO 5 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2022-03-04 07:44:39.948  INFO 5 --- [           main] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQLDialect
2022-03-04 07:44:41.089  INFO 5 --- [           main] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2022-03-04 07:44:41.098  INFO 5 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2022-03-04 07:44:42.590  INFO 5 --- [           main] ...Application        : Started Application in 5.939 seconds (JVM running for 6.39)
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
...

我们使用 Spring Boot v2.6.4 和 Spring Shell v2.0.1.RELEASE。 Spring Shell 应用程序是容器化的(Docker),我们通常以以下内容开始:

heroku run --type worker -a foo -- /env.sh java -jar ops.jar

你们中的任何人是否有一些关于如何解决甚至如何进一步调试这个问题的技巧或东西,即打印异常的整个堆栈跟踪?

这是否与 JLine 相关,无法与 Heroku 一起在 Docker 容器中使用?!然而,这在过去就像一种魅力。

如前所述,我们感谢任何有关如何进一步调试的提示或技巧。

干杯

Recently we are facing an issue that we cannot start our Spring Shell app on our Heroku worker node anymore. Directly after the shell app has started the console just prints java.lang.NullPointerException a million times (like there is kina a loop that is trying to instantiate a bean or something which is failing all the time).

Here is an excerpt:

Running /env.sh java -jar ops.jar on ⬢ foo... up, worker.8633 (Standard-1X)

2022-03-04 07:44:37.221  INFO 5 --- [           main] ...Application        : Starting Application v1.0.0-SNAPSHOT using Java 11.0.11 on 2e0b87b1-cecd-4720-8c27-4d39afba9615 with PID 5 (/ops.jar started by u27375 in /)
2022-03-04 07:44:37.226  INFO 5 --- [           main] ...Application        : No active profile set, falling back to 1 default profile: "default"
2022-03-04 07:44:38.012  INFO 5 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2022-03-04 07:44:38.129  INFO 5 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 110 ms. Found 10 JPA repository interfaces.
2022-03-04 07:44:38.886  INFO 5 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
2022-03-04 07:44:38.948  INFO 5 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 5.6.5.Final
2022-03-04 07:44:39.127  INFO 5 --- [           main] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2022-03-04 07:44:39.547  INFO 5 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2022-03-04 07:44:39.929  INFO 5 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2022-03-04 07:44:39.948  INFO 5 --- [           main] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQLDialect
2022-03-04 07:44:41.089  INFO 5 --- [           main] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2022-03-04 07:44:41.098  INFO 5 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2022-03-04 07:44:42.590  INFO 5 --- [           main] ...Application        : Started Application in 5.939 seconds (JVM running for 6.39)
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
...

We use Spring Boot v2.6.4 and Spring Shell v2.0.1.RELEASE. The Spring Shell app is containerized (Docker) and we usually start it with:

heroku run --type worker -a foo -- /env.sh java -jar ops.jar

Does anyone of you guys have some tips or something on how to solve or even how to debug this further, i.e., to print the whole stacktrace of the exception?

Could this be something related to JLine in a way that in cannot be used in a Docker container together with Heroku?! However, this worked like a charm in the past.

As said, we appreciate any hint or tip on how to debug this further.

Cheers

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文