Open hotdust opened 5 years ago
Could you please to use 0.3.2
version?
@pavolloffay thanks for reply. using 0.3.2 version, it worked. but there is another problem, maybe not relate to previous problem. if it's better to open new issue, I will do it.
AbstractAsyncConfiguration throws exception:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.scheduling.annotation.ProxyAsyncConfiguration': Injection of autowired dependencies failed; nested exception is java.lang.IllegalStateException: Only one AsyncConfigurer may exist
DefaultAsyncAutoConfiguration generate a AsyncConfigurer, and project framework(org.springblade) generates a AsyncConfigurer too. two AsyncConfigurer cause this exception.
BladeExecutorConfiguration sources:
@Configuration
@EnableAsync
@EnableScheduling
@AllArgsConstructor
@EnableConfigurationProperties({
BladeAsyncProperties.class
})
public class BladeExecutorConfiguration extends AsyncConfigurerSupport {
private final BladeAsyncProperties bladeAsyncProperties;
@Override
@Bean(name = "taskExecutor")
public Executor getAsyncExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(bladeAsyncProperties.getCorePoolSize());
executor.setMaxPoolSize(bladeAsyncProperties.getMaxPoolSize());
executor.setQueueCapacity(bladeAsyncProperties.getQueueCapacity());
executor.setKeepAliveSeconds(bladeAsyncProperties.getKeepAliveSeconds());
executor.setThreadNamePrefix("async-executor-");
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
return executor;
}
@Override
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
return new SimpleAsyncUncaughtExceptionHandler();
}
}
Glad to see that update worked. Would you be interested in submitting a PR to fix it?
@pavolloffay I will fix this one -- I am doing Hacktoberfest so this looks like a good candidate.
@bono007 awesome, go for it :+1: !
The intention is to use opentracing-spring-jaeger-cloud-starter
inside of Spring Boot w/o any web container. Is this correct @pavolloffay ? @hotdust is this what you want to do?
I created boot app w/ the initial specified deps. I was able to repro the first failure around the
error Type referred to is not an annotation type: org$springframework$web$bind$annotation$RestController
I then upgraded to 0.3.5 - same annotations error.
I then added spring-web
dependency and saw dependency issue around tracing properties...
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-10-10 16:33:29.121 ERROR 79462 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
APPLICATION FAILED TO START
Description:
Parameter 0 of method defaultSkipPatternBean in io.opentracing.contrib.spring.web.starter.SkipPatternAutoConfiguration$DefaultSkipPatternConfig required a bean of type 'io.opentracing.contrib.spring.web.starter.WebTracingProperties' that could not be found.
Action:
Consider defining a bean of type 'io.opentracing.contrib.spring.web.starter.WebTracingProperties' in your configuration.
4. I then added `@EnableConfigurationProperties({ WebTracingProperties.class})` to my config and got a clean startup. It immedaiately exited though as there is no web container or anything present.
### Summary
By using `0.3.5` and adding `spring-web` to pom.xml and `@EnableConfigurationProperties({ WebTracingProperties.class})` to my app configuration class I was able to get a clean startup.
Is it ok to be required to add `spring-web` or should it be able to startup w/o that? Just want to make sure I understand the ask/requirements before investing anything else into this.
Dependencies
Opentracing
Spring boot
Error Log
Others
if add
spring-web
dependency, error above disappears, but another error occurs (maybe about spring dependencies).