Skip to content

Failed to load ApplicationContext for MergedContextConfiguration #1530

Closed

Description

Hi,

I'm running tests on a simple Maven/Spring project.

If I run the tests with maven, they are Ok.

If I click on the individual tests, they are Ok.

But, if I click on Run Tests, a test fails with the error: java.lang.IllegalStateException: Failed to load ApplicationContext for MergedContextConfiguration ...

What is the difference? Can anything be configured to solve the Run Tests case?

Activity

  1. changed the title [-]java.lang.IllegalStateException: Failed to load ApplicationContext for MergedContextConfiguration[/-] [+]Failed to load ApplicationContext for MergedContextConfiguration[/+] on Feb 15, 2023
  2. jdneo commented on Feb 16, 2023

    @jdneo
    Member

    Could you share a sample project?

  3. anibalsanchez commented on Feb 16, 2023

    @anibalsanchez
    Author

    Sure, pls, give me a day to clean it up a little bit.

  4. anibalsanchez commented on Feb 17, 2023

    @anibalsanchez
    Author

    Looking into the exception details, there are other reported causes:

    ...
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springApplicationAdminRegistrar' defined in class path resource [org/springframework/boot/autoconfigure/admin/SpringApplicationAdminJmxAutoConfiguration.class]: org.springframework.boot:type=Admin,name=SpringApplication
    ....
    Caused by: javax.management.InstanceAlreadyExistsException: org.springframework.boot:type=Admin,name=SpringApplication
    ...
    

    This previous issue and workaround solved the issue: #1420 (comment)

    Case closed.

    Best Regards

  5. jdneo commented on Feb 20, 2023

    @jdneo
    Member

    Anibal Sanchez (@anibalsanchez) This surprises me if the issue is caused by Spring Boot Tools extension, cuz the issue should be fixed several months ago: #1435 (comment)

    What's the version of your extension?

  6. jdneo commented on Feb 21, 2023

    @jdneo
    Member

    Is it possible to provide a sample project? Thanks.

  7. kanidjar commented on Mar 9, 2023

    @kanidjar

    hi Sheng Chen (@jdneo), having the same issue as Anibal Sanchez (@anibalsanchez).

    "boot-java.live-information.automatic-connection.on": false
    

    fixed the issue on my side.

  8. jdneo commented on Mar 10, 2023

    @jdneo
    Member

    Hi Kevin Anidjar (@kanidjar), Is it possible to provide a sample project? I hope to check if there is any regression happens at the spring boot extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions