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 argument [SynchronousTransactionManager synchronousTransactionManager] #7869

Closed
aprietop opened this issue Aug 12, 2022 · 3 comments
Assignees

Comments

@aprietop
Copy link
Contributor

Expected Behavior

  • The given test case provided when creating the application using Micronaut Launch should pass.
  • The SynchronousTransactionManager should be provided

Actual Behaviour

Error starting Micronaut container
Missing bean argument [SynchronousTransactionManager synchronousTransactionManager]
The given test case does not pass.

com.amazonaws.serverless.exceptions.ContainerInitializationException: Error starting Micronaut container: Bean definition [io.micronaut.transaction.async.AsyncTransactionOperations] could not be loaded: Error instantiating bean of type  [io.micronaut.transaction.async.AsyncTransactionOperations]

Message: Missing bean argument [SynchronousTransactionManager synchronousTransactionManager] for type: io.micronaut.transaction.async.AsyncTransactionOperations. Required arguments: SynchronousTransactionManager synchronousTransactionManager
Path Taken: AsyncTransactionOperations.buildPrimaryAsyncTransactionOperations(SynchronousTransactionManager synchronousTransactionManager,CoroutineTxHelper coroutineTxHelper)
	at io.micronaut.function.aws.proxy.MicronautLambdaContainerHandler.initialize(MicronautLambdaContainerHandler.java:260)
	at io.micronaut.function.aws.proxy.MicronautLambdaContainerHandler.<init>(MicronautLambdaContainerHandler.java:193)
	at io.micronaut.function.aws.proxy.MicronautLambdaContainerHandler.<init>(MicronautLambdaContainerHandler.java:155)
	at io.micronaut.function.aws.proxy.MicronautLambdaHandler.<init>(MicronautLambdaHandler.java:45)
	at com.example.HomeControllerTest.setupSpec(HomeControllerTest.java:23)

Steps To Reproduce

  1. Create a Micronaut application with the following features using Micronaut Launch:

features: [annotation-api, app-name, aws-cdk, aws-lambda, aws-lambda-custom-runtime, aws-parameter-store, aws-v2-sdk, data, data-mongodb, gradle, http-client, jackson-databind, java, junit, logback, micronaut-build, mongo-sync, readme, shade, test-resources, testcontainers, yaml]

  1. Run the given test case

Environment Information

  • Windows
  • Application type: Micronaut Appication
  • Runtime: GraalVM Native Image in Custom Runtime
  • Java version: 17
  • OpenJDK Runtime Environment GraalVM CE 22.1.0 (build 17.0.3+7-jvmci-22.1-b06)

Example Application

https://github.com/aprietop/mongo-lambda-issue

Version

3.6.0

@fmonorchio
Copy link

I have this problem in an integration test where I'm using eager loading of singletons to check that all bean are configured correctly.
I'm passing a ContextBuilder class to @MicronautTest to do so.

There is a way to use eager loading and do the test pass? thanks

@wetted
Copy link
Contributor

wetted commented Oct 3, 2022

@aprietop @fmonorchio This works correctly as of 3.7.0. Please upgrade your Micronaut version and confirm it works for you.

ping @sdelamo

@aprietop
Copy link
Contributor Author

aprietop commented Oct 3, 2022

@fmonorchio @sdelamo @wetted
Yes, I have confirmed this now works fine with the 3.7.0 release. Therefore, I'm closing this issue.
Thank you!

@aprietop aprietop closed this as completed Oct 3, 2022
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

3 participants