Skip to content

Verbose and unhelpful logging with Boot + Jetty if context fails to load #3026

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
plaird opened this issue May 22, 2015 · 1 comment
Closed
Labels
status: duplicate A duplicate of another issue type: enhancement A general enhancement

Comments

@plaird
Copy link

plaird commented May 22, 2015

Description

We have a standard configuration for Spring Boot across a number of projects. If a developer makes a mistake in configuration, we have found the logging output to be difficult to work with. The example linked below demonstrates a mistake in a very simple Spring context configuration. It results in 340 lines of errors logged, much of it redundant log output. Actual use cases involve much richer context configuration, making the output much longer and harder to read.

The problem comes from redundant logging statements across Jetty, Spring, and Boot.
Because of that, this issue is being filed without a lot of hope for resolution.
But I thought I would raise attention to it anyway as it represents a usability problem for what otherwise is a great development environment.

Reproducer

An example Spring Boot project that demonstrates the problem is available here:

Workaround

logback.xml can be configured like the following, which suppresses all logging from the contributing classes:

  <logger name="org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext" level="OFF"  additivity="false"/>
  <logger name="org.springframework.boot.SpringApplication" level="OFF"  additivity="false"/>
  <logger name="org.eclipse.jetty.webapp.WebAppContext" level="OFF"  additivity="false"/>
  <logger name="org.eclipse.jetty.util.component.AbstractLifeCycle" level="OFF"  additivity="false"/>

Configuration

  • Spring Boot Web Starter (Tomcat excluded, SpringMVC excluded) 1.2.3.RELEASE
  • Spring Boot 1.2.3.RELEASE
  • Spring Core 4.1.6.RELEASE
  • Jetty 9.2.9.v20150224
  • Jersey-Spring3 2.14

Logging Code Points

The context creation exceptions bounce up the call stack, logging out at these locations (module:class:line):

  • jetty-util:AbstractLifeCycle:212
    • LOG.warn(FAILED+" " + this+": "+th,th);
  • jetty-webapp:WebAppContext:512
    • LOG.warn("Failed startup of context "+this, e);
  • spring-context:AbstractApplicationContext:487
    • logger.warn("Exception encountered during context initialization - cancelling refresh attempt", ex);
  • spring-boot:SpringApplication:338
    • this.log.error("Application startup failed", ex);
  • java.lang.ThreadGroup:1059 (Uncaught Exception Handler)
    • System.err.print("Exception in thread...
@wilkinsona
Copy link
Member

With Spring Boot 1.5, Jetty's warn-level logging still occurs (and we can't do much about that), but Boot now performs failure analysis. This results in the following output:

java -jar target/spring-boot-logging-issue-0.1.0.jar

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::       (v1.5.10.RELEASE)

2018-03-22 14:35:44.921  INFO 54017 --- [           main] org.test.Application                     : Starting Application v0.1.0 on aw-rmbp.local with PID 54017 (/Users/awilkinson/dev/temp/springbootloggingissue/target/spring-boot-logging-issue-0.1.0.jar started by awilkinson in /Users/awilkinson/dev/temp/springbootloggingissue)
2018-03-22 14:35:44.926  INFO 54017 --- [           main] org.test.Application                     : No active profile set, falling back to default profiles: default
2018-03-22 14:35:44.975  INFO 54017 --- [           main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@30946e09: startup date [Thu Mar 22 14:35:44 EDT 2018]; root of context hierarchy
2018-03-22 14:35:45.406  INFO 54017 --- [           main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2018-03-22 14:35:45.644  INFO 54017 --- [           main] org.eclipse.jetty.util.log               : Logging initialized @2291ms to org.eclipse.jetty.util.log.Slf4jLog
2018-03-22 14:35:45.769  INFO 54017 --- [           main] e.j.JettyEmbeddedServletContainerFactory : Server initialized with port: 8080
2018-03-22 14:35:45.771  INFO 54017 --- [           main] org.eclipse.jetty.server.Server          : jetty-9.4.8.v20171121, build timestamp: 2017-11-21T16:27:37-05:00, git hash: 82b8fb23f757335bb3329d540ce37a2a2615f0a8
2018-03-22 14:35:45.907  INFO 54017 --- [           main] org.eclipse.jetty.server.session         : DefaultSessionIdManager workerName=node0
2018-03-22 14:35:45.907  INFO 54017 --- [           main] org.eclipse.jetty.server.session         : No SessionScavenger set, using defaults
2018-03-22 14:35:45.909  INFO 54017 --- [           main] org.eclipse.jetty.server.session         : Scavenging every 660000ms
2018-03-22 14:35:45.913  INFO 54017 --- [           main] o.e.j.s.h.ContextHandler.application     : Initializing Spring embedded WebApplicationContext
2018-03-22 14:35:45.913  INFO 54017 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 940 ms
2018-03-22 14:35:45.996  WARN 54017 --- [           main] org.eclipse.jetty.webapp.WebAppContext   : Failed startup of context o.s.b.c.e.j.JettyEmbeddedWebAppContext@57fffcd7{/,[file:///private/var/folders/zq/v6xkr2696kv05jbf3bddt9680000gn/T/jetty-docbase.6937604434904957599.8080/],UNAVAILABLE}

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jerseyConfig': Unsatisfied dependency expressed through field 'widgetResource'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'widgetResource': Unsatisfied dependency expressed through field 'widgetContainer'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'widgetContainer': Unsatisfied dependency expressed through field 'widget'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.test.Widget' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:372) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:234) ~[spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
	at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:215) ~[spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
	at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addServletContextInitializerBeans(ServletContextInitializerBeans.java:91) ~[spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
	at org.springframework.boot.web.servlet.ServletContextInitializerBeans.<init>(ServletContextInitializerBeans.java:79) ~[spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.getServletContextInitializerBeans(EmbeddedWebApplicationContext.java:241) [spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.selfInitialize(EmbeddedWebApplicationContext.java:228) [spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.access$000(EmbeddedWebApplicationContext.java:89) [spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext$1.onStartup(EmbeddedWebApplicationContext.java:213) ~[spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
	at org.springframework.boot.context.embedded.jetty.ServletContextInitializerConfiguration$Initializer.callInitializers(ServletContextInitializerConfiguration.java:83) ~[spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
	at org.springframework.boot.context.embedded.jetty.ServletContextInitializerConfiguration$Initializer.doStart(ServletContextInitializerConfiguration.java:72) ~[spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.4.8.v20171121.jar!/:9.4.8.v20171121]
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:133) [jetty-util-9.4.8.v20171121.jar!/:9.4.8.v20171121]
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:107) [jetty-util-9.4.8.v20171121.jar!/:9.4.8.v20171121]
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113) [jetty-server-9.4.8.v20171121.jar!/:9.4.8.v20171121]
	at org.eclipse.jetty.server.handler.ScopedHandler.doStart(ScopedHandler.java:120) ~[jetty-server-9.4.8.v20171121.jar!/:9.4.8.v20171121]
	at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:844) ~[jetty-server-9.4.8.v20171121.jar!/:9.4.8.v20171121]
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:344) ~[jetty-servlet-9.4.8.v20171121.jar!/:9.4.8.v20171121]
	at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1515) ~[jetty-webapp-9.4.8.v20171121.jar!/:9.4.8.v20171121]
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1477) ~[jetty-webapp-9.4.8.v20171121.jar!/:9.4.8.v20171121]
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:785) ~[jetty-server-9.4.8.v20171121.jar!/:9.4.8.v20171121]
	at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:261) ~[jetty-servlet-9.4.8.v20171121.jar!/:9.4.8.v20171121]
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545) ~[jetty-webapp-9.4.8.v20171121.jar!/:9.4.8.v20171121]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.4.8.v20171121.jar!/:9.4.8.v20171121]
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:133) [jetty-util-9.4.8.v20171121.jar!/:9.4.8.v20171121]
	at org.eclipse.jetty.server.Server.start(Server.java:418) [jetty-server-9.4.8.v20171121.jar!/:9.4.8.v20171121]
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:107) [jetty-util-9.4.8.v20171121.jar!/:9.4.8.v20171121]
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113) [jetty-server-9.4.8.v20171121.jar!/:9.4.8.v20171121]
	at org.eclipse.jetty.server.Server.doStart(Server.java:385) [jetty-server-9.4.8.v20171121.jar!/:9.4.8.v20171121]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.4.8.v20171121.jar!/:9.4.8.v20171121]
	at org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainer.initialize(JettyEmbeddedServletContainer.java:104) [spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
	at org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainer.<init>(JettyEmbeddedServletContainer.java:82) [spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
	at org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory.getJettyEmbeddedServletContainer(JettyEmbeddedServletContainerFactory.java:561) [spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
	at org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory.getEmbeddedServletContainer(JettyEmbeddedServletContainerFactory.java:190) [spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:164) [spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134) [spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537) [spring-context-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) [spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) [spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) [spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
	at org.test.Application.main(Application.java:10) [classes!/:0.1.0]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_151]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_151]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_151]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151]
	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [spring-boot-logging-issue-0.1.0.jar:0.1.0]
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [spring-boot-logging-issue-0.1.0.jar:0.1.0]
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [spring-boot-logging-issue-0.1.0.jar:0.1.0]
	at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) [spring-boot-logging-issue-0.1.0.jar:0.1.0]
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jerseyConfig': Unsatisfied dependency expressed through field 'widgetResource'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'widgetResource': Unsatisfied dependency expressed through field 'widgetContainer'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'widgetContainer': Unsatisfied dependency expressed through field 'widget'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.test.Widget' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	... 69 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'widgetResource': Unsatisfied dependency expressed through field 'widgetContainer'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'widgetContainer': Unsatisfied dependency expressed through field 'widget'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.test.Widget' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	... 83 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'widgetContainer': Unsatisfied dependency expressed through field 'widget'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.test.Widget' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	... 96 common frames omitted
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.test.Widget' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1493) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1104) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585) ~[spring-beans-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	... 109 common frames omitted

2018-03-22 14:35:46.031  INFO 54017 --- [           main] org.eclipse.jetty.server.Server          : Started @2679ms
2018-03-22 14:35:46.044  WARN 54017 --- [           main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jerseyConfig': Unsatisfied dependency expressed through field 'widgetResource'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'widgetResource': Unsatisfied dependency expressed through field 'widgetContainer'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'widgetContainer': Unsatisfied dependency expressed through field 'widget'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.test.Widget' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
2018-03-22 14:35:46.047  INFO 54017 --- [           main] org.eclipse.jetty.server.session         : Stopped scavenging
2018-03-22 14:35:46.049  INFO 54017 --- [           main] o.e.jetty.server.handler.ContextHandler  : Stopped o.s.b.c.e.j.JettyEmbeddedWebAppContext@57fffcd7{/,[file:///private/var/folders/zq/v6xkr2696kv05jbf3bddt9680000gn/T/jetty-docbase.6937604434904957599.8080/],UNAVAILABLE}
2018-03-22 14:35:46.057  INFO 54017 --- [           main] utoConfigurationReportLoggingInitializer :

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2018-03-22 14:35:46.142 ERROR 54017 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :

***************************
APPLICATION FAILED TO START
***************************

Description:

Field widget in org.test.WidgetContainer required a bean of type 'org.test.Widget' that could not be found.


Action:

Consider defining a bean of type 'org.test.Widget' in your configuration.

@wilkinsona wilkinsona added the status: duplicate A duplicate of another issue label Mar 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants