It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage


Hey All,

I have created a Spring-Web-MVC-Test using the below Annotations



 When I run the test locally it compiles and build the .war file with no issues.

I tried running the similar test inside the docker image using the .yml file so to automate regression testing of our unit-tests. But I see a failed to load "Application Context" error.

java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext( ~[spring-test-4.3.8.RELEASE.jar:4.3.8.RELEASE]
at ~[spring-test-4.3.8.RELEASE.jar:4.3.8.RELEASE]
at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary( ~[spring-test-4.3.8.RELEASE.jar:4.3.8.RELEASE]
at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance( ~[spring-test-4.3.8.RELEASE.jar:4.3.8.RELEASE]
at org.springframework.test.context.TestContextManager.prepareTestInstance( ~[spring-test-4.3.8.RELEASE.jar:4.3.8.RELEASE]
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest( [spring-test-4.3.8.RELEASE.jar:4.3.8.RELEASE]
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall( [spring-test-4.3.8.RELEASE.jar:4.3.8.RELEASE]
at [junit-4.12.jar:4.12]
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock( [spring-test-4.3.8.RELEASE.jar:4.3.8.RELEASE]


Any help will be appreciated.


1 answer

0 votes

Hi @Terence, could you please provide some more details about what you are trying to do and how this relates to Atlassian?

I do have the same error, but with the new @WebMvcTest annotation. Posted this on SO:

Switching to your annotation version (which should work as well as per the docs), does not change anything. Seeing that my tests run fine locally, I think it may have something to do with the fact that pipelines run in a Docker container. If so, how does one configure that correctly?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder :  #!/bin/bash source "$(dirname "$0")/" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

4,054 views 4 22
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you