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
No qualifying bean of type [org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping] #2237
Comments
What version of Spring Boot are you using? |
spring-boot-1.2.0.RELEASE |
|
I got the 1.2.1 release, and I can see the
|
@paranoiabla I can't reproduce the failure with 1.2.1.RELEASE. I have a controller: @RestController
@RequestMapping("/")
public class MyController {
@RequestMapping("mapping")
public String mapping() {
return MvcUriComponentsBuilder.fromMappingName("MC#mapping").build();
}
} And this test that passes with 1.2.1.RELEASE: @RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = Gh2237Application.class)
@IntegrationTest("server.port=0")
@WebAppConfiguration
public class Gh2237ApplicationTests {
@Autowired
private ApplicationContext context;
@Value("${local.server.port}")
private int port;
private RestTemplate restTemplate = new TestRestTemplate();
@Test
public void primaryRequestMappingHandlerMapping() {
assertEquals(4, this.context.getBeansOfType(RequestMappingHandlerMapping.class).size());
ResponseEntity<String> entity = this.restTemplate.getForEntity(
"http://localhost:" + this.port + "/mapping", String.class);
assertEquals(HttpStatus.OK, entity.getStatusCode());
assertEquals("http://localhost:" + this.port + "/mapping", entity.getBody());
}
} It fails if I drop back to 1.2.0.RELEASE with the same four beans your app has:
If you'd like us to investigate further please provide us with a small sample that reproduces the problem on 1.2.1.RELEASE. |
Hi @philwebb It works now. Turns out I had forgotten the |
Why adding @EnableWebMVC cause this problem? |
This is covered in the reference documentation:
|
Following this question here:
http://stackoverflow.com/questions/26890727/spring-boot-issue-while-using-smvcurl-tag
I get the same error:
The text was updated successfully, but these errors were encountered: