[SOLVED] Spring boot: Failed to read candidate component class… Caused by: java.lang.ClassNotFoundException: org.springframework.dao.DataAccessException

This is a solution for an exception occurred when you try to run Spring boot application located in default package.

Problem

Unable to run Spring boot application because of the following exception:

 

Cause

Your application class is located in default package.

 

Solution

Move your classes into non default package structure like below:

before

 

after

 

Leave a Reply

2 Comments on "[SOLVED] Spring boot: Failed to read candidate component class… Caused by: java.lang.ClassNotFoundException: org.springframework.dao.DataAccessException"

avatar
  Subscribe  
newest oldest most voted
Notify of
Anushka
Guest

This worked for me. Thanks !

Anushka Sharma
Guest

This worked for me !

Close Menu