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

  • Home
  • SEARCH
  • 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 6149573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:28:30+00:00 2026-05-23T19:28:30+00:00

I have a service bean (annotated with @Service) which implements the ApplicationListener inteface for

  • 0

I have a service bean (annotated with @Service) which implements the ApplicationListener inteface for T type of event objects that extend the ApplicationEvent abstract Class. There is a pretty simple and clear example of this in the Spring docs here

However when i attempt to inject this bean into other ones using @Autowired i get is:

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

If i try to use something like @Resource then i get a class cast exception (attempting to inject a resource of one type but getting a Proxy).

  • 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-05-23T19:28:30+00:00Added an answer on May 23, 2026 at 7:28 pm

    If i try to use something like @Resource then i get a class cast
    exception (attempting to inject a resource of one type but getting a
    Proxy).

    This sounds like you are trying to reference it by class, whereas it is wired as an interface-based JDK proxy.

    If you have this class:

    @Service
    public class FooServiceImpl implements FooService{}
    

    wire it as:

    @Autowired
    private FooService fooService;
    

    not as:

    @Autowired
    private FooServiceImpl fooService;
    

    Reference:

    • AOP Proxying Mechanisms
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ServiceListFactoryBean which creates a list of service implementations: <bean id=services class=org.springframework.beans...ServiceListFactoryBean
I have the following bean defined: <sec:authentication-manager alias=authenticationManager> <sec:authentication-provider user-service-ref=userDetailsService /> </sec:authentication-manager> I guess
I currently have service classes that look something like this public class UserService :
I have a service returning an array of type BaseItem. BaseItem has N subtypes.
I have web service which i want to use to upload image to the
I have a service which is running in a system in several instances. I
I've a web service, which is basically a @Stateless EJB annotated with @WebService, and
I have a Web Service operation called getJobCostToDate(String jobnum) which when passed a job
What I would like to do is have a common Service class which has
I have a REST service which takes a JSON request. I want to validate

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.