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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:52:30+00:00 2026-05-27T17:52:30+00:00

I am getting this error org.springframework.beans.factory.BeanCreationException: Could not autowire method: This is my spring’s

  • 0

I am getting this error

org.springframework.beans.factory.BeanCreationException: 
Could not autowire method:

This is my spring’s xml configuration.

<bean ...>   
...
    <property name="InfoModel" ref="InfoModel"></property>
</bean>

Here is my code where I am autowiring this in Java class

  private InfoModel infoModel;

  @Autowired
  public void setInfoModel(InfoModel infoModel) {
    this.infoModel= infoModel;
  }

Am I missing something. I suspect that I should make an Interface of InfoModel in order to make it autowire?

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.model.InfoModel] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:920)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:789)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:703)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:547)
  • 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-27T17:52:31+00:00Added an answer on May 27, 2026 at 5:52 pm

    if you do @Autowired you don’t need to mark it as property in xml. just declare InfoModel as bean in XML and remove property from xml for you bean where you have injected InfoModel

    Summing up

    1 You need a bean definition in your XML for InfoModel

    2 You need to remove property from XML

    3 Make sure you have made your context annotation driven by adding

    <context:annotation-config />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep getting this error while setting up ehcache in Spring MVC. org.springframework.beans.factory.BeanCreationException: Error
Any idea why I am getting this exception? Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean
I am running NTLM using Spring Security, I am getting the following error org.springframework.beans.factory.NoSuchBeanDefinitionException:
I am getting an exception <code> Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name
I'm getting this Hibernate error: org.hibernate.MappingException: Could not determine type for: a.b.c.Results$BusinessDate, for columns:
I'm getting this error. my web.xml has this <servlet> <servlet-name>springweb</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/web-application-config.xml</param-value>
I'm using this tutorial: http://blog.springsource.org/2011/01/04/green-beans-getting-started-with-spring-mvc/ to run a Spring MVC app using spring's tool
Now i am getting this error in my spring application what this indicate ?
In my spring-servlet.xml I have <bean id=messageSource class=org.springframework.context.support.ReloadableResourceBundleMessageSource> <property name=basename value=/WEB-INF/messages /> </bean> My
I am using spring for some testing, and I am getting this error: java.lang.NoClassDefFoundError:

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.