aws / aws/serverless-java-container

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

Aberta
#305 1 comentário 0 reações 0 responsáveis Ver no GitHub
need feedback
Linguagem predominante
Java
Estrelas
1.6k
Forks
574
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

* 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'

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Reproduza o problema abrindo StreamLambdaHandler no IntelliJ e executando o evento padrão do API Gateway AWS Proxy por meio do comando sam local invoke mostrado. Rastreie como o diretório Function compilado é montado e como o toolkit resolve com.amazonaws.serverless.sample.springboot2.StreamLambdaHandler. A tarefa estará concluída quando a invocação de depuração carregar a classe e atingir o breakpoint selecionado sem ClassNotFoundException.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
aws, java, spring-boot
Domínio
api, backend, devtools
Tipo de issue
Bug
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.