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 4346924
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T12:14:18+00:00 2026-05-21T12:14:18+00:00

I have next structure: @Component public abstract class HuginJob extends QuartzJobBean {…} @Component(CisxJob) public

  • 0

I have next structure:

@Component public abstract class
HuginJob extends QuartzJobBean {...}


@Component("CisxJob") public class
CisxJob extends HuginJob {...}

Now I want to test CisxJob:

 @RunWith(SpringJUnit4ClassRunner.class)

 @ContextConfiguration({"/applicationContext-test.xml" })

public class CisxJobTest {

     @Autowired
     @Qualifier("CisxJob")
     private CisxJob          cisxJob;
..... }

Here is part of applicationContext-test.xml

<context:annotation-config />
<context:component-scan base-package="no.hugin.jobscheduler" />

Error is

org.springframework.beans.factory.BeanCreationException:
Error creating bean with name ‘no.hugin.jobscheduler.job.cisx.CisxJobTest’: Injection of autowired dependencies failed;
nested exception is rg.springframework.beans.factory.BeanCreationException:
Could not autowire field: private no.hugin.jobscheduler.job.cisx.CisxJob
no.hugin.jobscheduler.job.cisx.CisxJobTest.cisxJob; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:
No matching bean of type [no.hugin.jobscheduler.job.cisx.CisxJob] 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), @org.springframework.beans.factory.annotation.Qualifier(value=CisxJob)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:286)
………….

The problem is in extending of QuartzJobBean – but I need it.

Thank you

  • 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-21T12:14:18+00:00Added an answer on May 21, 2026 at 12:14 pm

    The problem is in a way Spring generates AOP proxies. When class being proxied implements any interfaces, Spring by default creates a JDK proxy that implement these interfaces.

    Since QuartzJobBean implements an interface Job, CisxJob is proxied as Job, and that proxy can’t be autowired to the field of type CisxJob.

    There are two solutions:

    • If your bean implement any interfaces, create an interface for its business methods as well, and use it as a field type:

       public interface CisxJob { ... }
      
       @Component("CisxJob")
       public class CisxJobImpl extends HuginJob implements CisxJob {...} 
      
    • Use proxy-target-class mode:

       <aop:aspectj-autoproxy proxy-target-class = "true" />
      

    See also:

    • 7.6 Proxying mechanisms
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the next structure of DTO objects: public class MainDTO implements Serializable {
I have next package structure webService.ear -- dependency.jar -- some.class Can I remove some.class
I have the next menu structure. <li class=menu-422><a href=item-1 title=>Item 1</a></li> <li class=menu-444><a href=item-2
I have custom plugin with the next structure. models.py looks like class ProductDescription(models.Model): name
I have the next class: public class GridViewControlModel : NotificationObject { DataTable datasource; public
I have a table with a next structure: +---------+----------+-------+ | user_id | group_id |
I have next interface public interface IMyInterface { string this[string key] { get; set;
I have next tables Order , Transaction , Payment . Class Order has some
I have next SVN repositories structure running Apache 2.2 under Windows Server 2008: http://example.com/svn/
have a next question: i.g. we have next html with structure: <html> <head> <script

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.