Skip to content
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

UnsatisfiedDependencyException in Pinpoint web application occurs when using batch profile #7091

Closed
cwJohnPark opened this issue Aug 10, 2020 · 2 comments · Fixed by #7092
Closed
Assignees
Milestone

Comments

@cwJohnPark
Copy link
Contributor

cwJohnPark commented Aug 10, 2020

What version of pinpoint are you using?

master/v2.1.0

Describe the bug

when I start Pinpoint Web Application with "profile=release,batch", Spring Boot BatchAutoConfiguration dependency error occurs

What did you do to trigger the bug?

  1. Ran with profile = release, batch
  2. The application failed to start
  3. The app threw org.springframework.beans.factory.UnsatisfiedDependencyException

Expected behavior

Not fail to start Pinpoint web application

Logs

08-10 15:13:34.034 [           main] ERROR o.s.b.d.LoggingFailureAnalysisReporter   -- 

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

Description:

Parameter 1 of method jobLauncherCommandLineRunner in org.springframework.boot.autoconfigure.batch.BatchAutoConfiguration required a bean of type 'org.springframework.batch.core.explore.JobExplorer' that could not be found.


Action:

Consider defining a bean of type 'org.springframework.batch.core.explore.JobExplorer' in your configuration.

08-10 15:13:34.958 ERROR WebApp                              : [WebApp] could not launch app.
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jobLauncherCommandLineRunner' defined in class path resource [org/springframework/boot/autoconfigure/batch/BatchAutoConfiguration.class]: Unsatisfied dependency expressed through method 'jobLauncherCommandLineRunner' parameter 1; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.batch.core.explore.JobExplorer' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:797)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:538)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:893)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
	at com.navercorp.pinpoint.web.WebStarter.start(WebStarter.java:32)
	at com.navercorp.pinpoint.web.WebApp.main(WebApp.java:20)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.batch.core.explore.JobExplorer' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1714)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1270)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1224)
	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:884)
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788)
	... 18 more

Process finished with exit code 0

Additional context

When I add BatchAutoConfiguration.class to the array of exclusion to @EnableAutoConfiguration, The app doesn't fail to start.

Reference to @minwoo-jung

@minwoo-jung
Copy link
Member

@cwJohnPark
Doesn't the problem reproduce when profile=release,batch is entered instead of profile=release,debug?

@cwJohnPark
Copy link
Contributor Author

@cwJohnPark
Doesn't the problem reproduce when profile=release,batch is entered instead of profile=release,debug?

Thank you !
I fixed the word you mentioned.

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

Successfully merging a pull request may close this issue.

3 participants