[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

4
Leave a Reply

avatar
3 Comment threads
1 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
4 Comment authors
lukasz.cieslaDiogoAnushka SharmaAnushka Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Anushka
Guest
Anushka

This worked for me. Thanks !

Anushka Sharma
Guest
Anushka Sharma

This worked for me !

Diogo
Guest
Diogo

Perfect! Why does it not work?

Close Menu