Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8968203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:25:01+00:00 2026-06-15T17:25:01+00:00

Getting error No matching bean of type [foo.bar.service.AccountService] found for dependency: expected at least

  • 0

Getting error

 No matching bean of type [foo.bar.service.AccountService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

my service:

public interface AccountService {

@Service
public class AccountServiceImpl implements AccountService {

So I should get the implementation

Where I am trying to get it :

public class CustomAuthentication implements AuthenticationProvider {

@Autowired
private AccountService accountService;

In my other class also doing same thing, but there it works.

@Controller
public class AccountController {

@Autowired
private AccountService accountService;

When I remove the those 2 lines from my CustomAuthentication, getting no errors.

configuration just incase:

    <context:component-scan base-package="foo.bar" />
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T17:25:02+00:00Added an answer on June 15, 2026 at 5:25 pm

    Only a spring managed object can Autowire another component/service/repository.

    public class CustomAuthentication implements AuthenticationProvider need to be spring managed

    like

    @Controller
    public class AccountController
    

    Try annotating the CustomAuthenitcation with @Component

    @Component
    public class CustomAuthentication implements AuthenticationProvider
    

    and let me know how CustomAuthentication Object is created. CustomAuthentication object should be a proxy obtained by requesting to Spring(ApplicationContext.getBean() or autowired in another bean).

    UPDATE:

    reason for this error is you have two config files. spring-servlet.xml and spring-security.xml. Beans defined in spring-security.xml is not able to find those in other.

    so you should try something like <import resource="spring-servlet.xml"/> in spring-security.xml .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting an error message like so: Linear.hs:215:27: Couldn't match expected type `forall
getting error while try to start service
I am getting these error while creating bean id , Im using spring :
string text; getline(text.c_str(),256); 1) I am getting an error error: no matching function for
At the line temp.insert(it); I keep getting the error No matching member function for
Any idea why I am getting this exception? Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean
I am getting this error: main.cpp:31: error: no matching function for call to 'QWebFrame::addToJavaScriptWindowObject(QString,
Getting error when I tried like this: $ci =& get_instance(); $ci->db->select(CONCAT_WS(' ',users.name_first,users.name_last) AS user_name,CONCAT_WS('
Getting error while inserting values into database (SQL Server 2008) Implicit conversion from data
Now getting error Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.