Bonsoir à tous
J'essaye de mettre en oeuvre un batch spring en extrayant les données à partir d'un fichier excel. Mais je fais face à l'erreur suivante:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118 2021-03-25 20:59:57.596 INFO 2040 --- [ restartedMain] com.sasem.syade.SyadeApplication : Starting SyadeApplication using Java 15.0.2 on Didier with PID 2040 (C:\Users\Sabech\Documents\eclipse\syade\target\classes started by Sabech in C:\Users\Sabech\Documents\eclipse\syade) 2021-03-25 20:59:57.599 INFO 2040 --- [ restartedMain] com.sasem.syade.SyadeApplication : No active profile set, falling back to default profiles: default 2021-03-25 20:59:57.675 INFO 2040 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable 2021-03-25 20:59:57.676 INFO 2040 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG' 2021-03-25 20:59:58.390 INFO 2040 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode. 2021-03-25 20:59:58.447 INFO 2040 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 48 ms. Found 1 JPA repository interfaces. 2021-03-25 20:59:58.648 INFO 2040 --- [ restartedMain] o.s.c.a.ConfigurationClassEnhancer : @Bean method ScopeConfiguration.stepScope is non-static and returns an object assignable to Spring's BeanFactoryPostProcessor interface. This will result in a failure to process annotations such as @Autowired, @Resource and @PostConstruct within the method's declaring @Configuration class. Add the 'static' modifier to this method to avoid these container lifecycle issues; see @Bean javadoc for complete details. 2021-03-25 20:59:58.659 INFO 2040 --- [ restartedMain] o.s.c.a.ConfigurationClassEnhancer : @Bean method ScopeConfiguration.jobScope is non-static and returns an object assignable to Spring's BeanFactoryPostProcessor interface. This will result in a failure to process annotations such as @Autowired, @Resource and @PostConstruct within the method's declaring @Configuration class. Add the 'static' modifier to this method to avoid these container lifecycle issues; see @Bean javadoc for complete details. 2021-03-25 20:59:59.121 INFO 2040 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 9092 (http) 2021-03-25 20:59:59.132 INFO 2040 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2021-03-25 20:59:59.132 INFO 2040 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.44] 2021-03-25 20:59:59.254 INFO 2040 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2021-03-25 20:59:59.254 INFO 2040 --- [ restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1578 ms 2021-03-25 20:59:59.467 INFO 2040 --- [ restartedMain] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default] 2021-03-25 20:59:59.520 INFO 2040 --- [ restartedMain] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.29.Final 2021-03-25 20:59:59.671 INFO 2040 --- [ restartedMain] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final} 2021-03-25 20:59:59.780 INFO 2040 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... 2021-03-25 21:00:00.021 INFO 2040 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. 2021-03-25 21:00:00.037 INFO 2040 --- [ restartedMain] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect 2021-03-25 21:00:01.497 INFO 2040 --- [ restartedMain] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] 2021-03-25 21:00:01.511 INFO 2040 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default' 2021-03-25 21:00:01.572 INFO 2040 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729 2021-03-25 21:00:01.666 INFO 2040 --- [ restartedMain] com.sasem.syade.batch.BatchConfig : entrain de read 2021-03-25 21:00:01.668 INFO 2040 --- [ restartedMain] com.sasem.syade.batch.BatchConfig : ici le fichier system_harmonise1.xls 2021-03-25 21:00:01.670 INFO 2040 --- [ restartedMain] com.sasem.syade.batch.BatchConfig : parser le fichier excel 2021-03-25 21:00:01.674 INFO 2040 --- [ restartedMain] com.sasem.syade.batch.BatchConfig : a deja read 2 2021-03-25 21:00:01.680 INFO 2040 --- [ restartedMain] com.sasem.syade.batch.BatchConfig : processor 2021-03-25 21:00:01.682 INFO 2040 --- [ restartedMain] com.sasem.syade.batch.BatchConfig : writter 2021-03-25 21:00:02.133 WARN 2040 --- [ restartedMain] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning 2021-03-25 21:00:02.249 INFO 2040 --- [ restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor' 2021-03-25 21:00:02.438 WARN 2040 --- [ restartedMain] o.s.b.a.batch.JpaBatchConfigurer : JPA does not support custom isolation levels, so locks may not be taken when launching Jobs 2021-03-25 21:00:02.444 INFO 2040 --- [ restartedMain] o.s.b.c.r.s.JobRepositoryFactoryBean : No database type set, using meta data indicating: MYSQL WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/C:/Users/Sabech/.m2/repository/com/thoughtworks/xstream/xstream/1.4.7/xstream-1.4.7.jar) to field java.util.TreeMap.comparator WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release 2021-03-25 21:00:02.613 INFO 2040 --- [ restartedMain] o.s.b.c.l.support.SimpleJobLauncher : No TaskExecutor has been set, defaulting to synchronous executor. 2021-03-25 21:00:02.715 INFO 2040 --- [ restartedMain] o.s.s.c.ThreadPoolTaskScheduler : Initializing ExecutorService 'taskScheduler' 2021-03-25 21:00:02.786 INFO 2040 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 9092 (http) with context path '' 2021-03-25 21:00:02.795 INFO 2040 --- [ scheduling-1] com.sasem.syade.batch.Scheduler : Batch programmé pour tourner toutes les 8 secondes 2021-03-25 21:00:02.798 INFO 2040 --- [ restartedMain] com.sasem.syade.SyadeApplication : Started SyadeApplication in 5.927 seconds (JVM running for 7.063) 2021-03-25 21:00:02.808 INFO 2040 --- [ restartedMain] o.s.b.a.b.JobLauncherApplicationRunner : Running default command line with: [] 2021-03-25 21:00:02.988 INFO 2040 --- [ restartedMain] o.s.b.c.l.support.SimpleJobLauncher : Job: [SimpleJob: [name=listSHJob]] launched with the following parameters: [{}] 2021-03-25 21:00:03.043 INFO 2040 --- [ scheduling-1] o.s.b.c.l.support.SimpleJobLauncher : Job: [SimpleJob: [name=listSHJob]] launched with the following parameters: [{time=1616702402796}] 2021-03-25 21:00:03.197 INFO 2040 --- [ scheduling-1] o.s.batch.core.job.SimpleStepHandler : Executing step: [processingStep] 2021-03-25 21:00:03.299 INFO 2040 --- [ restartedMain] o.s.batch.core.job.SimpleStepHandler : Executing step: [processingStep] 2021-03-25 21:00:03.868 ERROR 2040 --- [ scheduling-1] o.s.batch.core.step.AbstractStep : Encountered an error executing step processingStep in job listSHJob org.springframework.batch.item.excel.ExcelFileParseException: Exception parsing Excel file. at org.springframework.batch.item.excel.AbstractExcelItemReader.doRead(AbstractExcelItemReader.java:100) ~[spring-batch-excel-1.0.1.jar:na] at org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader.read(AbstractItemCountingItemStreamItemReader.java:93) ~[spring-batch-infrastructure-4.3.2.jar:4.3.2] at org.springframework.batch.item.excel.AbstractExcelItemReader.read(AbstractExcelItemReader.java:66) ~[spring-batch-excel-1.0.1.jar:na] at org.springframework.batch.core.step.item.SimpleChunkProvider.doRead(SimpleChunkProvider.java:91) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE] at org.springframework.batch.core.step.item.SimpleChunkProvider.read(SimpleChunkProvider.java:157) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE] at org.springframework.batch.core.step.item.SimpleChunkProvider$1.doInIteration(SimpleChunkProvider.java:116) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE] at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:375) ~[spring-batch-infrastructure-4.3.2.jar:4.3.2] at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:215) ~[spring-batch-infrastructure-4.3.2.jar:4.3.2] at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:145) ~[spring-batch-infrastructure-4.3.2.jar:4.3.2] at org.springframework.batch.core.step.item.SimpleChunkProvider.provide(SimpleChunkProvider.java:110) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE] at org.springframework.batch.core.step.item.ChunkOrientedTasklet.execute(ChunkOrientedTasklet.java:69) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE] at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:406) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE] at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:330) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE] at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) ~[spring-tx-5.3.5.jar:5.3.5] at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:271) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE] at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:81) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE] at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:375) ~[spring-batch-infrastructure-4.3.2.jar:4.3.2] at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:215) ~[spring-batch-infrastructure-4.3.2.jar:4.3.2] at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:145) ~[spring-batch-infrastructure-4.3.2.jar:4.3.2] at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:257) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE] at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:200) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE] at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:148) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE] at org.springframework.batch.core.job.AbstractJob.handleStep(AbstractJob.java:392) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE] at org.springframework.batch.core.job.SimpleJob.doExecute(SimpleJob.java:135) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE] at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:306) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE] at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:135) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE] at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50) ~[spring-core-5.3.5.jar:5.3.5] at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:128) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) ~[na:na] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:564) ~[na:na] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.3.5.jar:5.3.5] at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) ~[spring-aop-5.3.5.jar:5.3.5] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.5.jar:5.3.5] at org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration$PassthruAdvice.invoke(SimpleBatchConfiguration.java:127) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.5.jar:5.3.5] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215) ~[spring-aop-5.3.5.jar:5.3.5] at com.sun.proxy.$Proxy75.run(Unknown Source) ~[na:na] at com.sasem.syade.batch.BatchLauncher.run(BatchLauncher.java:27) ~[classes/:na] at com.sasem.syade.batch.Scheduler.perform(Scheduler.java:19) ~[classes/:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) ~[na:na] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:564) ~[na:na] at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) ~[spring-context-5.3.5.jar:5.3.5] at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-5.3.5.jar:5.3.5] at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[na:na] at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[na:na] at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) ~[na:na] at java.base/java.lang.Thread.run(Thread.java:832) ~[na:na] Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'UNITE_STAT' of bean class [com.sasem.syade.dao.SystemeHarmonise]: Bean property 'UNITE_STAT' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter? at org.springframework.beans.BeanWrapperImpl.createNotWritablePropertyException(BeanWrapperImpl.java:243) ~[spring-beans-5.3.5.jar:5.3.5] at org.springframework.beans.AbstractNestablePropertyAccessor.processLocalProperty(AbstractNestablePropertyAccessor.java:432) ~[spring-beans-5.3.5.jar:5.3.5] at org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:278) ~[spring-beans-5.3.5.jar:5.3.5] at org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:266) ~[spring-beans-5.3.5.jar:5.3.5] at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:104) ~[spring-beans-5.3.5.jar:5.3.5] at org.springframework.validation.DataBinder.applyPropertyValues(DataBinder.java:851) ~[spring-context-5.3.5.jar:5.3.5] at org.springframework.validation.DataBinder.doBind(DataBinder.java:747) ~[spring-context-5.3.5.jar:5.3.5] at org.springframework.validation.DataBinder.bind(DataBinder.java:732) ~[spring-context-5.3.5.jar:5.3.5] at org.springframework.batch.item.excel.mapping.BeanWrapperRowMapper.mapRow(BeanWrapperRowMapper.java:161) ~[spring-batch-excel-1.0.1.jar:na] at org.springframework.batch.item.excel.AbstractExcelItemReader.doRead(AbstractExcelItemReader.java:97) ~[spring-batch-excel-1.0.1.jar:na] ... 52 common frames omitted 2021-03-25 21:00:03.881 ERROR 2040 --- [ restartedMain] o.s.batch.core.step.AbstractStep : Encountered an error executing step processingStep in job listSHJob
Si quelqu'un peut avoir pour moi quelques piste de solution. merci
Partager