-
Notifications
You must be signed in to change notification settings - Fork 140
Error running Spring Boot Tests when a webEnvironment has been enabled #230
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
Comments
In case it helps, I'm experiencing the exact same thing with the same specifications, except I'm using Ubuntu 16.04. |
Same for us.
|
Why is
EDIT: OK so it seems by default, |
Same here.
EDIT: My tests have the following configuration: |
Maybe the code should be something like this ...
instead of ...
??? |
Hi @stewartmatheson, I'm also facing the same issue. Is there a work around for this to get the test classes run ? |
Hi @stewartmatheson, I tried using @SpringBootTest instead of @SpringBootTest(webEnvironment=SpringBootTest.WebEnvironment.MOCK, classes={Main.class}), but still it results in the same error -> ava.lang.IllegalStateException: Failed to load ApplicationContext Please help |
Hi @derjust @ryonday @stewartmatheson , Any idea on when to expect this issue #230 to be resolved ? |
I made a fix, but I can't create a branch to the pull request. I need help! |
You should be able to branch this to your own Github, push the Changes and then PR from there to this Repo here. See other PRs as a blueprint on how to do this. |
@tiagocpeixoto can you push your branch somewhere or send me a patch? I will test for you with my setup and create the PR for you if thats easier. |
@stewartmatheson @jakobgalbavy Thank you! I created a PR. Hope it helps! Feel free to give me feedback. |
Hi @tiagocpeixoto , looks like some checks have failed on the PR. |
…ons and aws-sdk dependency version)
…ct its dependencies)
Do you know IF the PR can be accepted and WHEN it will be? TY. |
@derjust Could someone review it's merged request 🙏 |
@tiagocpeixoto looks like the fix didn't completely resolve the issue. I am still seeing this error with your fix. ( I have published a jar from the master branch, into our nexus repo and used it as the dependency for my project)
|
Explain to me how can I reproduce the error and I will try to fix it. I built a project with the fix I made and now my app works as expected. You can, e.g., show your dynamodb config. TY |
Hi @tiagocpeixoto, I work with @naveentammineni. Here's a simple example repo that shows the problem: https://github.com/pluttrell/spring-data-dynamodb-5.1.0-issue. To provide you some context, we're following this example to override the table names: https://github.com/derjust/spring-data-dynamodb/wiki/Alter-table-name-during-runtime. In the example repo, if we run
It appears that the new model put in place for 5.1.0 doesn't properly take into account deployments with custom If we mark both methods that provide those beans to temporarily work around this issue, and run the unit tests, we get the same issue as when we originally ran the unit tests. If I run the SpringBootApp, we get what @naveentammineni posted. Here's the root cause by:
If we remove Thanks. |
Keep an eye on #230 there is also a repo linked that shows this error: |
I made a new fix. Please test it. My tests with a custom |
Hi, i tried @tiagocpeixoto fix and it actually solved the issue for me. Please solve the merge conflicts in the PR Best regards, |
Hey guys, any prediction for when this PR will be merged? This is being a blocker for us. |
Having this same issue, any update on when the fix will be available in maven? |
Thanks for the great work! Is there any ETA on the 5.1.1 release for this? |
Any updates here? |
Push. Who can accept @tiagocpeixoto PR? We are blocked and need this fix! |
push. its really important |
Hope there can be some progress, and a new release here soon. It is a blocker |
This now works for me. It seems to have been fixed in the Spring Framework (see spring-projects/spring-framework#22409). This was linked from spring-projects/spring-boot#15898 in Spring Boot, and fixed in Spring Boot 2.1.4.RELEASE (see changelog in https://github.com/spring-projects/spring-boot/releases/tag/v2.1.4.RELEASE) I've upgraded to Spring Boot 2.1.5.RELEASE, and can now test with a RANDOM PORT set as WebEnvironment. It appears that it is generally considered bad practice for a FactoryBean to not have a default constructor, but can move forward now :) |
Sadly i cannot confirm.
|
I did some playing around, and produced the same error as you Everything works for me if I define the DynamoDBMapperConfig like so:
and However, if I try to use a different bean name for dynamoDBMapperConfig than I run into that problem. I tried naming the bean, and passing that name through to So going back to a Primary bean with the default name is all that works for the moment, atleast until it sounds like should be fixed in 5.1.1. Hopefully it might help somone |
@maccamlc |
@shexbeer I use TableNameOverride for prefix, fwiw |
…nfigExtension conflicts)
I made a new repo and am publishing snapshots from https://github.com/boostchicken/spring-data-dynamodb Send any pull requests you want, currently publishing to OSSRH snapshots, want to do a release in the next couple days |
Expected Behavior
The application context to load when using spring boot test with the web environment
Actual Behavior
The context fails to load. The following error is reported.
Steps to Reproduce the Problem
Specifications
All those information are logged by
org.socialsignin.spring.data.dynamodb.repository.support.DynamoDBRepositoryFactory
onINFO
level on startup.Or use
java -version
andmvn dependency:tree | grep -E 'spring|aws'
to provide those version numbers.The text was updated successfully, but these errors were encountered: