Skip to content

Spring Boot 1.3.0 with actuator won't start #2910

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

Closed
jordanjennings opened this issue May 4, 2015 · 6 comments
Closed

Spring Boot 1.3.0 with actuator won't start #2910

jordanjennings opened this issue May 4, 2015 · 6 comments

Comments

@jordanjennings
Copy link

Not sure if bugs against the snapshot version are tracked here, apologies if this should go somewhere else.

In any case, the issue is that actuator appears to be having some issues in the latest snapshot which prevent spring boot from starting up properly. This even happens with an empty project.

To reproduce it, set up a project using https://start.spring.io/ and keep the defaults except for these options:

  • Type: Gradle Project
  • Java Version: 1.8
  • Spring boot Version: 1.3.0 (SNAPSHOT)
  • Check Web and Actuator for project dependencies

Download the project and run it with gradle bootRun, and it will fail to start with lots of error messages that I don't know how to interpret :) If you remove actuator from the dependencies then it starts up without issue. This started happening within the last week at most. Here's the stack trace:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'endpointHandlerMapping' defined in class path resource [org/springframework/boot/actuate/autoconfigure/EndpointW
ebMvcAutoConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Cannot map public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.E
ndpointMvcAdapter.invoke()
to {[/info],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}.
 It is already mapped to {[/env],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:766)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:812)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContex521)va:
        at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:687)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:958)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:947)
        at demo.DemoApplication.main(DemoApplication.java:10)
Caused by: java.lang.IllegalStateException: Cannot map public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
to {[/info],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}.
 It is already mapped to {[/env],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}
        at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistry.assertUniqueMethodMapping(AbstractHandlerMethodMapping.java:546)
        at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistry.register(AbstractHandlerMethodMapping.java:507)
        at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.registerHandlerMethod(AbstractHandlerMethodMapping.java:240)
        at org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping.registerHandlerMethod(EndpointHandlerMapping.java:98)
        at org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping.registerHandlerMethod(EndpointHandlerMapping.java:51)
        at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.detectHandlerMethods(AbstractHandlerMethodMapping.java:215)
        at org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping.afterPropertiesSet(EndpointHandlerMapping.java:77)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstrwireCapableBeanFactory.java:1574)

Thanks for taking a look, and thanks for this amazing project!

@shakuzen
Copy link
Member

shakuzen commented May 4, 2015

I am having this issue too and it looks like it is from about an hour ago (https://build.spring.io/browse/BOOT-WIN-JOB1-290/log). I think #2908 might be the same issue and a pull request to fix it has been made. I hope this can be resolved soon.

@rstoyanchev
Copy link
Contributor

This is almost certainly a result of recent changes checked into Spring Framework master today. Looking into it.

@rstoyanchev
Copy link
Contributor

I've re-opened https://jira.spring.io/browse/SPR-11541 which is the underlying cause for this.

@rstoyanchev
Copy link
Contributor

I've pushed a fix to the Spring Framework after verifying it works with the above instructions. It should become available soon. Feel free to re-open if need be but it should work.

@jordanjennings
Copy link
Author

Thanks, for the moment until an updated snapshot is available I have worked around the problem by adding the following lines to my gradle build (uses the snapshot build from May 2nd instead of the one from today):

compile("org.springframework:spring-web:4.2.0.BUILD-20150502.215038-267")
compile("org.springframework:spring-webmvc:4.2.0.BUILD-20150502.215038-267")

@philwebb
Copy link
Member

philwebb commented May 5, 2015

@jordanjennings The updated SNAPSHOT is available. You might need to run your build using -U to force maven to update snapshot dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants