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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:07:05+00:00 2026-06-03T08:07:05+00:00

I have a question here, how beans defined in applicationContext.xml could be available to

  • 0

I have a question here, how beans defined in “applicationContext.xml” could be available to controllers defined in let’s say “spring-servlet.xml”, so i can skip this kind of errors i have.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/home' defined in ServletContext resource [/WEB-INF/mmapp-servlet.xml]: Cannot resolve reference to bean 'equipementService' while setting bean property 'equipementService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'equipementService' is defined

applicationContext.xml

<?xml version="1.0" ?>
<!DOCTYPE beans PUBLIC 
"-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">

<beans>
    <bean name="equipementService"
        class="mmapp.service.SimpleEquipementService" />
    <bean name="equipement1"
        class="mmapp.domain.Equipement" />

</beans>

mmapp-servlet.xml

<?xml version="1.0" ?>
<!DOCTYPE beans PUBLIC
"-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">

<beans>

    <bean name="/home" class="mmapp.web.HelloController">
        <property name="equipementService" ref="equipementService" />
    </bean>
</beans>
  • 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-03T08:07:07+00:00Added an answer on June 3, 2026 at 8:07 am

    A Spring based web-application normally has multiple runtime Spring application contexts –

    1. A root application context(which is loaded up during the start-up of the servlet container), here is where you normally put your beans for your services – the root application context is loaded up by using a ContextLoaderListener, typically using these entries in your web.xml file:

    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath*:META-INF/spring/applicationContext*.xml</param-value>
    </context-param>
    

    1. One or more web application contexts, which is considered a child of the root application context, holding the beans related to the UI – controllers etc. This is configured by using a Dispatcher Servlet, a special servlet provided by Spring that knows to delegate the calls appropriately to the Spring Container. The beans in the root application context are visible to the beans defined here, BUT not the other way around – this way providing a level of separation between the UI layer and the services layer . This is a typical configuration entry in web.xml file:

    <servlet>
        <servlet-name>lovemytasks</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/spring/mmapp-servlet.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    

    If you have defined the beans this way, the equipementService should be visible to your controller.

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

Sidebar

Related Questions

So here's the scenario: I have a Spring XML configuration with some lazy-beans, some
Let's say I have following Spring config (version of Spring is 3.0.3): <?xml version=1.0
Spring 3.1 + Tomcat I have a bit of a design question here: There
This question comes from here but can be a totally independent question. I have
I have a question here regarding iPhone app submission. I have a free application
I have a quick question here. I know that the cakePHP find('first') function returns
I have a silly question here. I define a class with many data members,
C# question here.. I have a UTF-8 string that is being interpreted by a
Noob question here! I have an array with hashes that looks like this: arr
I have an other active question HERE regarding some hopeless memory issues that possibly

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.