Spring Boot - Exception Encountered During Context Initialization. How to Know the Reason of Error

Exception encountered during context initialization - cancelling refresh attempt org.springframework.beans.factory.BeanDefinitionStoreException

Actually I found the answer it was because my eclipse was using jdk 17 to run whereas I had jdk 16.0.2 installed you just have to click the project->build path->configure build path->java compiler->compiler compliance level to a lower jdk
thanks to everyone who helped

Exception encountered during context initialization - cancelling refresh attempt: UnsatisfiedDependencyException

In your JPA entity, you need to create a no-arg constructor in the Post class.

constructor is required to have Hibernate initialize the entity; private is allowed but package-private (or public) visibility is required for runtime proxy generation and efficient data retrieval without bytecode instrumentation.

If you are on Java 11 or later version, javassist should be on the classpath

<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.23.1-GA</version>
</dependency>

Exception encountered during context initialization - Incompatible library?

From the Stack trace,its clearly stated that it is not able to find EmployeeService.

 No qualifying bean of type [org.dstech.examplespring.service.EmployeeService]

You are trying to autowire EmployeeService in the controller where it is failing

@Autowired
EmployeeService service;

Just check if you have defined this EmployeeService bean in the applicationContext or you have annotated it with @Service

Exception during context initialization -

Ok, it took me a day but it's working. It appeared that maven was using extra dependencies, project used 2 versions of few libraries. Deleting all maven repositories from my drive did not help. After pushing the project to github, removing everything from my pc, and downloading the project. Everything went back to normal. Thank you @Alexander for help



Related Topics



Leave a reply



Submit