Estou tentando cadastrar um funcionário, mas no momento após eu selecionar a unidade de trabalho em que tenho que digitar '0' pra sair do while, o compilador joga um IllegalStateException.
Utilizei o arquivo do professor e continua dando o mesmo problema ao tentar cadastrar os funcionários.
Gostaria de saber o que é para poder corrigir na minha aplicação.
Digite o cargoId
1
Digite o unidadeId (Para sair digite 0)
1
Digite o unidadeId (Para sair digite 0)
0
2022-05-19 22:01:18.609 INFO 15260 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-05-19 22:01:18.620 ERROR 15260 --- [ main] o.s.boot.SpringApplication : Application run failed
java.lang.IllegalStateException: Failed to execute CommandLineRunner
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:780) ~[spring-boot-2.6.7.jar:2.6.7]
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:761) ~[spring-boot-2.6.7.jar:2.6.7]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:310) ~[spring-boot-2.6.7.jar:2.6.7]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) ~[spring-boot-2.6.7.jar:2.6.7]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) ~[spring-boot-2.6.7.jar:2.6.7]
at br.com.guido.spring.data.SpringDataApplication.main(SpringDataApplication.java:34) ~[classes/:na]
Caused by: java.time.format.DateTimeParseException: Text '05-19-2022' could not be parsed at index 2
at java.base/java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:2052) ~[na:na]
at java.base/java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1954) ~[na:na]
at java.base/java.time.LocalDate.parse(LocalDate.java:430) ~[na:na]
at br.com.guido.spring.data.service.CrudFuncionarioService.salvar(CrudFuncionarioService.java:92) ~[classes/:na]
at br.com.guido.spring.data.service.CrudFuncionarioService.inicial(CrudFuncionarioService.java:50) ~[classes/:na]
at br.com.guido.spring.data.SpringDataApplication.run(SpringDataApplication.java:55) ~[classes/:na]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:777) ~[spring-boot-2.6.7.jar:2.6.7]
... 5 common frames omitted
2022-05-19 22:01:18.622 INFO 15260 --- [ main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2022-05-19 22:01:18.624 INFO 15260 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2022-05-19 22:01:18.631 INFO 15260 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.