question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`@AutoConfigureWebTestClient` breaks when SpringMVC is on the classpath

See original GitHub issue

spring boot 2.0.0-RELEASE + spring-boot-starter-web-services 2.0.0.RELEASE Tests with

@RunWith(SpringRunner::class)
@SpringBootTest
@AutoConfigureWebTestClient
class DemoApplicationTests {...

Application not started after adding spring-boot-starter-web-services to dependencies

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.test.web.reactive.server.WebTestClient]: Factory method ‘webTestClient’ threw exception; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named ‘webHandler’ available

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
S1lentControlcommented, Mar 2, 2018

I solved the problem by excluding spring-webmvc

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web-services</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-web</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-webmvc</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
0reactions
snicollcommented, Mar 30, 2018

Now that the related issue is properly fixed (thanks @philwebb) I can give it another try at merging 282bd9f

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring Boot Features
This section dives into the details of Spring Boot. Here you can learn about the key features that you may want to use...
Read more >
spring-cloud/spring-cloud-contract - Gitter
RC2 here and I'm still getting org.springframework.beans.factory. ... to my deps @AutoConfigureWebTestClient still seems to be broken :-(.
Read more >
A brand new website interface for an even better experience!
AutoConfigureWebTestClient ` breaks when SpringMVC is on the classpath.
Read more >
Error creating bean with name 'securityConfig' defined in file
... in conjuction with other annotations for instance @AutoConfigureMockMvc or @AutoConfigureWebTestClient depending on which client to use.
Read more >
Spring Boot Reference Guide
Mapping Error Pages outside of Spring MVC . ... Add Servlets, Filters, and Listeners by Using Classpath Scanning . ... break Spring Boot...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found