NPE on org.springframework.boot.SpringApplication.getMainApplicationClass() with AOT
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- aws, java, spring-boot
調査の方向性
SpringDelegatingLambdaContainerHandler と示されている依存関係のバージョンを使用して、AOT Lambda の起動を再現します。SpringApplication.getMainApplicationClass() と EnvironmentPostProcessorApplicationListener.addAotGeneratedEnvironmentPostProcessorIfNecessary から開始し、その後 ServerlessMVC の初期化パスを追跡します。報告された NPE や後続の dispatcher 失敗が発生せずにアプリケーションが起動すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Hi!
I'm trying to implement AOT into a simple java lambda
I'm using the com.amazonaws.serverless.proxy.spring.SpringDelegatingLambdaContainerHandler handler
Dependencies:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>3.5.7</version>
</dependency>
<dependency>
<groupId>com.amazonaws.serverless</groupId>
<artifactId>aws-serverless-java-container-springboot3</artifactId>
<version>2.1.5</version>
</dependency>
Logs:
Picked up JAVA_TOOL_OPTIONS: -Dspring.aot.enabled=true
Picked up _JAVA_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,quiet=y,address=*:5005 -XX:MaxHeapSize=2834432k -XX:+UseSerialGC -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Djava.net.preferIPv4Stack=true
11:25:50.498 [main] INFO org.springframework.cloud.function.serverless.web.FunctionClassUtils -- Main class: class org.example.IssueApplication
11:25:50.520 [main] INFO com.amazonaws.serverless.proxy.AsyncInitializationWrapper -- Async initialization will wait for 5775ms (init grace time is configured to 150)
11:25:50.522 [Thread-0] INFO com.amazonaws.serverless.proxy.AsyncInitializationWrapper -- Starting async initializer
11:25:50.550 [Thread-1] INFO org.springframework.cloud.function.serverless.web.ServerlessMVC -- Starting application with the following configuration classes:
11:25:50.551 [Thread-1] INFO org.springframework.cloud.function.serverless.web.ServerlessMVC -- IssueApplication
11:28:37.898 [Thread-1] ERROR org.springframework.boot.SpringApplication -- Application run failed
java.lang.NullPointerException: Cannot invoke "java.lang.Class.getName()" because the return value of "org.springframework.boot.SpringApplication.getMainApplicationClass()" is null
at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.addAotGeneratedEnvironmentPostProcessorIfNecessary(EnvironmentPostProcessorApplicationListener.java:160)
at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:130)
at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:115)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:185)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:178)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:156)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:138)
at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81)
at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64)
at java.base/java.lang.Iterable.forEach(Unknown Source)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:353)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:313)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1361)
at org.springframework.cloud.function.serverless.web.ServerlessMVC.initContext(ServerlessMVC.java:125)
at org.springframework.cloud.function.serverless.web.ServerlessMVC.lambda$initializeContextAsync$1(ServerlessMVC.java:112)
at java.base/java.lang.Thread.run(Unknown Source)
11:28:37.900 [Thread-1] INFO org.springframework.cloud.function.serverless.web.ServerlessMVC -- Application is started successfully.
Exception in thread "Thread-1" java.lang.IllegalStateException: java.lang.NullPointerException: Cannot invoke "java.lang.Class.getName()" because the return value of "org.springframework.boot.SpringApplication.getMainApplicationClass()" is null
at org.springframework.cloud.function.serverless.web.ServerlessMVC.lambda$initializeContextAsync$1(ServerlessMVC.java:115)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.Class.getName()" because the return value of "org.springframework.boot.SpringApplication.getMainApplicationClass()" is null
at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.addAotGeneratedEnvironmentPostProcessorIfNecessary(EnvironmentPostProcessorApplicationListener.java:160)
at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:130)
at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:115)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:185)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:178)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:156)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:138)
at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81)
at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64)
at java.base/java.lang.Iterable.forEach(Unknown Source)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:353)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:313)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1361)
at org.springframework.cloud.function.serverless.web.ServerlessMVC.initContext(ServerlessMVC.java:125)
at org.springframework.cloud.function.serverless.web.ServerlessMVC.lambda$initializeContextAsync$1(ServerlessMVC.java:112)
... 1 more
Cannot invoke "org.springframework.web.servlet.DispatcherServlet.getServletContext()" because "this.dispatcher" is null: java.lang.NullPointerException
java.lang.NullPointerException: Cannot invoke "org.springframework.web.servlet.DispatcherServlet.getServletContext()" because "this.dispatcher" is null
at org.springframework.cloud.function.serverless.web.ServerlessMVC.getServletContext(ServerlessMVC.java:138)
at com.amazonaws.serverless.proxy.spring.SpringDelegatingLambdaContainerHandler.handleRequest(SpringDelegatingLambdaContainerHandler.java:68)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
END RequestId: 8baa5a53-ca92-4fd0-bc7e-b3720868d264
REPORT RequestId: 8baa5a53-ca92-4fd0-bc7e-b3720868d264 Init Duration: 0.02 ms Duration: 171628.48 ms Billed Duration: 171629 ms Memory Size: 4096 MB Max Memory Used: 4096 MB
- 主要言語
- Java
- スター
- 1.6k
- フォーク
- 575
- 平均マージ
- 1日 15時間
- マージ済み PR(30日)
- 12
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
aws/serverless-java-container のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
aws/serverless-java-container#1729 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
aws/serverless-java-container#1715 ·
メンテナーはふだん 1 日以内に返信
-
Support for API Gateway mTLS clientCert field対応中かも @2748109647 が 10 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 48/100
aws/serverless-java-container#1726 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
aws/serverless-java-container#1568 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
aws/serverless-java-container#1551 ·
メンテナーはふだん 1 日以内に返信
aws/serverless-java-container の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
ls1intum/thesis-management#1473 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
LunaDeerMC/Dominion#301 · コメント 1 件 ·
-
[FEATURE] Expose external refresh, node-level translog and warmer stats対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンuntriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
opensearch-project/opensearch-prometheus-exporter#680 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100