Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Spring Basics Modeling, Storing, and Presenting Data Create a Data Repository Component

Mohamed Mandour
Mohamed Mandour
7,783 Points

I have been getting this error when I am trying to add the repository component into a controller.


Field gifRepository in controller.GifController required a bean of type 'gifDAO.GifRepository' that could not be found.


Consider defining a bean of type 'gifDAO.GifRepository' in your configuration.

Please post the code of your controller class and your repository class.

Joseph Marcus
Joseph Marcus
11,069 Points

Did you annotate your GifRepository class?

1 Answer

Carlos Mota
Carlos Mota
2,596 Points

Your probably still have the new keyword you need to take it out, I had the same problem and that was my fix