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
How to Check Whether a Field Exists or Not in Mongodb
Java.Lang.Noclassdeffounderror: Lorg/Apache/Logging/Log4J/Logger; But the Artifact Exists
Convert String With Dot or Comma to Float Number
How to View Apache Parquet File in Windows
Java How to Set an Auto Increment Attribute
Comparing Two List by Using Java8 Matching Methods
Spring Rest Handling Empty Request Body (400 Bad Request)
How to Do Sorting in Array List Without Using Collections in Java
Selenium Webdriver: Modifying Navigator.Webdriver Flag to Prevent Selenium Detection
How to Get the Position of a Element in a Queue
How to Identify File Type by Base64 Encoded String of a Image
Nb: Java_Home Should Point to a Jdk Not a Jre
Replace Whitespace in Json Keys
Maven Builds Are Working, But Junit Is Throwing a Nosuchmethoderror
How to Query Multiple Hash Keys in Dynamodb