- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我浏览了这个链接: Spring Bean Inheritance Using Annotations Bean reference back issue 以及其他链接,但它还没有解决我的问题。
我正在研究 Spring Boot Batch 示例。在此示例中,我收到以下错误 -
org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'employeesJob' defined in class path resource [com/prateek/job/EmployeesJob.class]: factory-bean reference points back to the same bean definition
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:703) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:667) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:635) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1489) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1012) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.requiresEagerInitForType(DefaultListableBeanFactory.java:498) [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:418) [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:390) [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:189) [spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:710) [spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:535) [spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
at com.prateek.SpringBatchClassicDbApplication.main(SpringBatchClassicDbApplication.java:10) [classes/:na]
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dataSourceInitializerPostProcessor': Unsatisfied dependency expressed through field 'beanFactory'; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'employeesJob' defined in class path resource [com/prateek/job/EmployeesJob.class]: factory-bean reference points back to the same bean definition
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:587) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:91) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:373) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1350) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:580) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:503) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:226) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:710) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:535) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
at com.prateek.SpringBatchClassicDbApplication.main(SpringBatchClassicDbApplication.java:10) [classes/:na]
@Configuration
@EnableBatchProcessing
public class EmployeesJob {
@Autowired
private JobBuilderFactory jobBuilderFactory;
@Autowired
private StepBuilderFactory stepBuilderFactory;
@Autowired
private DataSource dataSource;
@Bean
public EmployeesProcessor employeesProcessor() {
return new EmployeesProcessor();
}
@Bean
public JdbcCursorItemReader<Employees> employeeReader1(){
JdbcCursorItemReader<Employees> itemReader = new JdbcCursorItemReader<>();
itemReader.setDataSource(dataSource);
itemReader.setSql("SELECT employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle FROM employees");
itemReader.setRowMapper(new EmployeeMapper());
itemReader.setFetchSize(200);
return itemReader;
}
@Bean
public FlatFileItemWriter<Employees> employeeWriter(){
FlatFileItemWriter<Employees> fileItemWriter = new FlatFileItemWriter<>();
fileItemWriter.setResource(new FileSystemResource("csv/employees.csv"));
BeanWrapperFieldExtractor<Employees> fieldExtractor = new BeanWrapperFieldExtractor<>();
fieldExtractor.setNames(new String[] {"employeeNumber", "lastName", "firstName", "extension", "email", "officeCode", "reportsTo", "jobTitle"});
DelimitedLineAggregator<Employees> lineAggregator = new DelimitedLineAggregator<>();
lineAggregator.setDelimiter(",");
lineAggregator.setFieldExtractor(fieldExtractor);
fileItemWriter.setLineAggregator(lineAggregator);
fileItemWriter.setShouldDeleteIfEmpty(true);
return fileItemWriter;
}
@Bean
public Step step1() {
return stepBuilderFactory.get("step1")
.<Employees, Employees>chunk(10)
.reader(employeeReader1())
.processor(new EmployeesProcessor())
.writer(employeeWriter())
.build();
}
@Bean
public Job employeesJob() {
return jobBuilderFactory.get("employeesJob")
.incrementer(new RunIdIncrementer())
.flow(step1())
.end()
.build();
}
}
spring.datasource.url=jdbc:mysql://localhost:3306/classicmodels
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.username=root
spring.datasource.password=root
# SPRING BATCH (BatchProperties)
# Execute all Spring Batch jobs in the context on startup.
#spring.batch.job.enabled=true
# LOGGING
logging.level.org.springframework=DEBUG
logging.level.org.springframework.boot.autoconfigure=ERROR
public class EmployeesProcessor implements ItemProcessor<Employees, Employees>{
@Override
public Employees process(Employees employees) throws Exception {
return employees;
}
}
最佳答案
最后我能够解决这个问题。你不能像employeesJob() 一样给jobName 和className。我更改了工作名称,现在工作正常。
关于spring - 在类路径资源 : factory-bean reference points back to the same bean definition 中定义的名称为 'employeesJob' 的 bean 定义无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51226066/
有人告诉我,如果我只有一个“东西”,比如家(不是多个家),我应该在 routes.rb 中使用资源 :home,而不是资源 :home。但是当我查看路由时,POST 函数似乎想要 home#creat
Activity 开始。这些代码框架顺利通过。 // Initialize array adapters. One for already paired devices and //
资源 search-hadoop.com search-hadoop.com索引所有邮件列表,非常适合历史搜索。当你遇到问题时首先在这里搜索,因为很可能有人已经遇到了你的问题。 邮件列表 在A
我是 WPF 的新手,正在努力使用位于单独程序集中的样式。这就是我正在做的:- 我有一个带有\Themes 文件夹的类库项目,其中包含一个“generic.xaml”,它合并了\Themes 内的子文
我正在编写一个使用虚拟树状文件结构的插件。基本上它就像一个包含文件的标准文件系统,区别在于这些文件实际上并不存在于文件系统中的特定位置,而只是 java 对象。 这些当前由使用 SettingProv
如果我在 XAML 中使用以下内容,我会收到错误消息: 错
我正在使用 laravel 资源来获取 api 的数据: return [ 'id' => $this->id, 'unread' =>
我有以下 pom.xml: 4.0.0 mycompany resource-fail 0.0.1-SNAPSHOT BazBat
许多GDI +类都实现IDisposable,但是我不确定何时应该调用Dispose。对于使用new或静态方法(例如Graphics.CreateGraphics)创建的实例来说,这很明显。但是,由属
我正在构建一组 RESTful 资源,其工作方式如下:(我将使用“people”作为示例): 获取/people/{key} - 返回一个人对象 (JSON) GET/people?first_nam
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,因为
我有一个使用 $resource 的简单 Controller : var Regions = $resource('mocks/regions.json'); $scope.regions =
在 Azure 门户中,如何查看不同资源之间的依赖关系。我特别想查看哪些资源正在使用我要删除的存储。 最佳答案 您可以使用应用程序洞察应用程序 map 来执行此操作: 您还可以打开存储帐户的日志记录:
我正在使用 ionic 生成资源(图标和启动画面)。我正在使用 ionic v2.1.0 和 cordova v6.4.0。 到目前为止我一直在使用(它在以前的版本中工作): cordova plat
是否可以使用 Assets 包含子文件夹中的文件? 示例:[base_url]/assets/css/pepper-grinder/jquery-ui-1.8.11.custom.min.css 最佳
我正在阅读一些尝试教授 Android 开发的书。在书中,作者概述了 res/下的一些目录。他提到 res/menu 包含基于 XML 的菜单规范。他还提到了保存“通用文件”的 res/raw。当我创
关闭。这个问题是opinion-based 。目前不接受答案。 想要改进这个问题吗?更新问题,以便 editing this post 可以用事实和引文来回答它。 . 已关闭 9 年前。 Improv
我在服务器上使用 express-resource。在我的 AngularJS Controller 中: var User = $resource('/services/users/:use
因此,每当我运行我的应用程序时,它都会立即崩溃并给出以下错误: No package identifier when getting value for resource number 0x00000
对于我正在创建的(网络)应用程序,我需要使用基本身份验证在我的 UIWebView 中加载页面。 现在设置我使用的授权 header : NSString *result = [NSString st
我是一名优秀的程序员,十分优秀!