Quando o nome do cargo é composto por 2 palavras por exemplo, apresenta erro no console e no banco de dados salva apenas a primeira palavra.
Qual ação você quer executar:
0 - Sair
1 - Cargo
1
Descrição do cargo
GERENTE
Salvo
Qual ação você quer executar:
0 - Sair
1 - Cargo
1
Descrição do cargo
ANALISTA DE SISTEMAS
Salvo
Qual ação você quer executar:
0 - Sair
1 - Cargo
2021-03-04 05:26:15.423 INFO 10373 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-03-04 05:26:15.433 ERROR 10373 --- [ main] o.s.boot.SpringApplication : Application run failed
java.lang.IllegalStateException: Failed to execute CommandLineRunner
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:807) ~[spring-boot-2.4.3.jar:2.4.3]
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:788) ~[spring-boot-2.4.3.jar:2.4.3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:333) ~[spring-boot-2.4.3.jar:2.4.3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1311) ~[spring-boot-2.4.3.jar:2.4.3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300) ~[spring-boot-2.4.3.jar:2.4.3]
at br.com.alura.spring.data.SpringDataApplication.main(SpringDataApplication.java:23) ~[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.SpringDataApplication.run(SpringDataApplication.java:35) ~[classes/:na]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:804) ~[spring-boot-2.4.3.jar:2.4.3]
... 5 common frames omitted
2021-03-04 05:26:15.434 INFO 10373 --- [ main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2021-03-04 05:26:15.436 INFO 10373 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2021-03-04 05:26:15.439 INFO 10373 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.