Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing bean leads to kotlin.UninitializedPropertyAccessException for containerized micronaut function on aws lambda #1378

Open
22dasi1bwi opened this issue May 18, 2022 · 1 comment

Comments

@22dasi1bwi
Copy link

Expected Behavior

Injecting beans should be possible.

Actual Behaviour

Injecting a simple bean, leads to kotlin.UninitializedPropertyAccessException.

Steps To Reproduce

  1. Checkout https://github.com/22dasi1bwi/mn-serverless-with-docker-image-example .
  2. Build the project.
  3. Run the tests -> See that BookRequestHandlerTest(a @MicronautLambdaTest) is green.
  4. Use Dockerfile to build an Image.
  5. Push image to ECR and launch the function. Alternatively test the function locally.
  6. When the handler is executed the following exception is thrown:
  "errorMessage": "lateinit property simpleBean has not been initialized",
  "errorType": "kotlin.UninitializedPropertyAccessException",
  "stackTrace": [
    "example.micronaut.BookRequestHandler.getSimpleBean(BookRequestHandler.kt:18)",
    "example.micronaut.BookRequestHandler.execute(BookRequestHandler.kt:21)",
    "example.micronaut.BookRequestHandler.execute(BookRequestHandler.kt:9)",
    "io.micronaut.function.aws.MicronautRequestHandler.handleRequest(MicronautRequestHandler.java:128)"
  ]
}```

### Environment Information

- Operating System: Arch Linux
- JDK version: 11.0.15

### Example Application

https://github.com/22dasi1bwi/mn-serverless-with-docker-image-example

### Version

3.4.4
@22dasi1bwi
Copy link
Author

Hey, @sdelamo !
I have struggled with that issue for a long time already. Is there something obvious I'm missing??

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant