O SCANNER NÃO ESTÁ CAPTURANDO NOMES COMPOSTOS.
Fiz tudo direitinho no meu projeto e abri outro tópico para solucionar esse problema, porém não obtive solução. Enfim, as outras opções também estão bugadas. Agora, fazendo download do projeto do curso, o problema continua.
Qual acao de cargo deseja executar
0 - Sair
1 - Salvar
2 - Atualizar
3 - Visualizar
4 - Deletar
1
Descricao do cargo
Auxiliar Administrativo
Salvo
Qual acao de cargo deseja executar
0 - Sair
1 - Salvar
2 - Atualizar
3 - Visualizar
4 - Deletar
2021-03-05 04:38:42.624 INFO 7606 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-03-05 04:38:42.627 ERROR 7606 --- [ main] o.s.boot.SpringApplication : Application run failed
java.lang.IllegalStateException: Failed to execute CommandLineRunner
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:798) ~[spring-boot-2.3.3.RELEASE.jar:2.3.3.RELEASE]
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:779) ~[spring-boot-2.3.3.RELEASE.jar:2.3.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:322) ~[spring-boot-2.3.3.RELEASE.jar:2.3.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) ~[spring-boot-2.3.3.RELEASE.jar:2.3.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.3.3.RELEASE.jar:2.3.3.RELEASE]
at br.com.alura.spring.data.SpringDataApplication.main(SpringDataApplication.java:35) ~[classes/:na]
Caused by: java.util.InputMismatchException: null
at java.base/java.util.Scanner.throwFor(Scanner.java:939) ~[na:na]
at java.base/java.util.Scanner.next(Scanner.java:1594) ~[na:na]
at java.base/java.util.Scanner.nextInt(Scanner.java:2258) ~[na:na]
at java.base/java.util.Scanner.nextInt(Scanner.java:2212) ~[na:na]
at br.com.alura.spring.data.service.CrudCargoService.inicial(CrudCargoService.java:29) ~[classes/:na]
at br.com.alura.spring.data.SpringDataApplication.run(SpringDataApplication.java:53) ~[classes/:na]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:795) ~[spring-boot-2.3.3.RELEASE.jar:2.3.3.RELEASE]
... 5 common frames omitted
2021-03-05 04:38:42.629 INFO 7606 --- [ main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2021-03-05 04:38:42.630 INFO 7606 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2021-03-05 04:38:42.633 INFO 7606 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.