NPE on org.springframework.boot.SpringApplication.getMainApplicationClass() with AOT
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
- Type d'issue
- Bug
- Clarté
- À clarifier
- Activité
- À l'abandon
- Stack technique
- aws, java, spring-boot
Piste de recherche
Reproduisez le démarrage d’AOT Lambda à l’aide de SpringDelegatingLambdaContainerHandler et des versions de dépendances indiquées. Commencez par SpringApplication.getMainApplicationClass() et EnvironmentPostProcessorApplicationListener.addAotGeneratedEnvironmentPostProcessorIfNecessary, puis suivez le chemin d’initialisation de ServerlessMVC. La tâche est terminée lorsque l’application démarre sans la NPE signalée ni l’échec ultérieur du dispatcher.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Langage dominant
- Java
- Étoiles
- 1.6k
- Forks
- 575
- Merge moyen
- 1 j 15 h
- PR mergées (30 j)
- 12
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de aws/serverless-java-container
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
aws/serverless-java-container#1729 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
aws/serverless-java-container#1715 ·
Les mainteneurs répondent en général sous 1 jour
-
Support for API Gateway mTLS clientCert fieldPeut-être pris @2748109647 l’a pris il y a 10 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 48/100
aws/serverless-java-container#1726 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 1-2 jours Accessibilité débutants 42/100
aws/serverless-java-container#1568 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 1-2 jours Accessibilité débutants 42/100
aws/serverless-java-container#1551 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de aws/serverless-java-container
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
ls1intum/thesis-management#1473 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
LunaDeerMC/Dominion#301 · 1 commentaire ·
-
[FEATURE] Expose external refresh, node-level translog and warmer statsPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverteuntriaged
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
opensearch-project/opensearch-prometheus-exporter#680 ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100