java.lang.ClassNotFoundException when debug using aws-toolkit-jetbrains in IntelliJ

Aperta
#305 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
aws, java, spring-boot
Ambito
api, backend, devtools

Direzione di ricerca

Riproduci il problema aprendo StreamLambdaHandler in IntelliJ ed eseguendo l’evento API Gateway AWS Proxy predefinito tramite il comando sam local invoke mostrato. Traccia come viene assemblata la directory Function compilata e come il toolkit risolve com.amazonaws.serverless.sample.springboot2.StreamLambdaHandler. L’attività è completata quando l’invocazione di debug carica la classe e raggiunge il breakpoint selezionato senza ClassNotFoundException.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

need feedback
  • Framework version: 1.4
  • Implementations: Spring Boot2

Scenario

Debug from StreamLambdaHandler using the toolkit in IntelliJ, java.lang.ClassNotFoundException: com.amazonaws.serverless.sample.springboot2.StreamLambdaHandler will occur

Expected behavior

Debug to desired breakpoint in IntelliJ

Actual behavior

java.lang.ClassNotFoundException: com.amazonaws.serverless.sample.springboot2.StreamLambdaHandler will occur

Steps to reproduce

  1. git clone the sample project
  2. Open Java class StreamLambdaHandler and click the lambda icon to debug the code.
  3. Use default event template of 'API Gateway AWS Proxy' as input, others set as default.
  4. Error output in console.

Full log output

/usr/local/bin/sam local invoke --template /Users/ryan/Documents/WorkSpace/Java/aws/lambda/pet-store/src/main/.aws-sam/build/template.yaml --event "/private/var/folders/vf/msvny93n2990vpxj3gvw2lb00000gn/T/[Local] StreamLambdaHandler-event.json" --debug-port 53272
Invoking com.amazonaws.serverless.sample.springboot2.StreamLambdaHandler (java8)
2019-11-25 20:12:29 Found credentials in environment variables.

Fetching lambci/lambda:java8 Docker container image......
Mounting /Users/ryan/Documents/WorkSpace/Java/aws/lambda/pet-store/src/main/.aws-sam/build/Function as /var/task:ro,delegated inside runtime container
Connected to the target VM, address: 'localhost:53272', transport: 'socket'
START RequestId: 04e64b0e-d63e-1dda-7e9f-801bd72b2989 Version: $LATEST
java.lang.ClassNotFoundException: com.amazonaws.serverless.sample.springboot2.StreamLambdaHandler
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)

Exception in thread "main" java.lang.Error: java.lang.RuntimeException: java.lang.RuntimeException: Unexpected status code from invocation/response: 299
at lambdainternal.AWSLambda.(AWSLambda.java:66)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at lambdainternal.LambdaRTEntry.main(LambdaRTEntry.java:114)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Unexpected status code from invocation/response: 299
at lambdainternal.LambdaRuntime.reportDone(LambdaRuntime.java:219)
at lambdainternal.AWSLambda.startRuntime(AWSLambda.java:318)
at lambdainternal.AWSLambda.(AWSLambda.java:64)
... 3 more
Caused by: java.lang.RuntimeException: Unexpected status code from invocation/response: 299
at lambdainternal.LambdaRuntime.reportDone(LambdaRuntime.java:216)
... 5 more
Disconnected from the target VM, address: 'localhost:53272', transport: 'socket'

Lingua principale
Java
Stelle
1.6k
Fork
575
Merge medio
1g 15h
PR unite (30g)
12

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di aws/serverless-java-container

Tutte le issue di aws/serverless-java-container

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.