Error Starting Applicationcontext in Spring Boot App

Error starting ApplicationContext in Spring Boot App

I solved the problem by excluding hibernate-validator dependency in pom.xml. It is working fine without any issues.

I am getting "Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled." Solution for this?

Remove spring-context dependency - you have the spring boot parent, and dont introduce dependencies of spring with a different version in general.

IMPORTANT: don't run SpringBoot main inside of CommandLineRunner implementing class. In general grab all that stuff from run method and use it in main and remove implements CommandLineRunner for everything to work.

Also you don't need EnableAutoConfiguration as @SpringBootApplication annotation includes it

You also don't need PropertySourcesPlaceholderConfigurer as Spring Boot provides one. Consider reading documentation on Spring Boot.

Additionally in SpringBoot connection to database is done automatically if you provide properties in application.properties file - like so:

spring.datasource.url=jdbc:mysql://localhost:3306/yourDatabaseName?useSSL=false
spring.datasource.username=yourDatabaseUsername
spring.datasource.password=yourDatabasePassword

here is a blog post example for Spring JDBC https://javamondays.com/simple-java-jdbc-example/

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. How can I solved Problem?

According to your error.log

 java.lang.NullPointerException: Cannot invoke "org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.getPatterns()" because "this.condition" is null

So please resolve the NullPointerException in your PatternsRequestCondition

Spring Boot Error starting ApplicationContext / Error creating bean with name 'entityManagerFactory'

Your JDBC URL is wrong

jdbc/mysql://localhost:3306:projekat?useUnicode=true&useSSL=false

should be

jdbc:mysql://localhost:3306:projekat?useUnicode=true&useSSL=false

See documentation for more details



Related Topics



Leave a reply



Submit