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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:25:10+00:00 2026-05-27T12:25:10+00:00

I have been tasked with updating a old project that I did not write.

  • 0

I have been tasked with updating a old project that I did not write.

The project is Spring MVC based and has an older Spring Controller configuration that I am unfamiliar with.

The controllers have bean configurations as follows

<bean id="controllerName" class="the.project.controller.class">
<property name"serviceName">
  <ref bean="serviceName">
 </property>
<property name"successView">
  <value>viewName</value>
 </property>
</bean>

where serviceName refers to a class annotated with @Service as follows

  @Service(value=serviceName)

Is this the correct replacement for the xml configuration ?

@Autowired
@Qualifier("serviceName")
ServiceNameImpl serviceName

thanks

edit here is the organization of the serviceName class and interface

  public interface ServiceName {
   // methods omitted
 }

 @Service(value="serviceName")
 public class ServiceNameImpl implments ServiceName {
 //methods omitted
 }

The @Resource annotation is not available to me ( Spring 3.0.7) and Autowire as above fails ( as it appears the type is not as expected as described below )

  org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching beans of type [the.project.ServiceNameImpl] found for dependency

Given the edits, what am I doing wrong here ( Apologies for leaving out this information )?

in the end I need to be able to access the methods of the interface and its implementation

for example

serviceName.doSomething(someVar);
  • 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-27T12:25:10+00:00Added an answer on May 27, 2026 at 12:25 pm

    That’s correct, but consider using private modifier for serviceName. Another way would be to use @Resource:

    @Resource
    private ServiceNameClass serviceName;
    

    Note that in this case you don’t need a @Qualifier("serviceName") – @Resource autowires by (field) name while @Autowired uses type by default. Only a problem when you have several beans of the same/compatible type.

    Also you can skip the controllerName bean definition altogether by annotating controller class with @Controller.

    BTW you can also shorten the XML configuration a bit by using the following syntax:

    <bean id="controllerName" class="the.project.controller.class">
        <property name"serviceName" ref="serviceName"/>
        <property name"successView" value="viewName"/>
    </bean>
    

    (IntelliJ suggests this transformation and performs it for you).

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

Sidebar

Related Questions

I have been tasked to write a script that will enable tcp and named
So I have this Access Database Project file that I have been tasked to
I have been tasked with decrypting a file in Java that has been encrypted
I have been tasked with going through a number of ColdFusion sites that have
I have been tasked with developing a solution that tracks changes to a database.
I have been tasked with creating a program that will generate an amortization schedule.
I have been tasked with updating my teams dev. environment. This environment will be
I have been tasked with building a new web project from scratch, with the
I have been tasked with developing a Firefox add-on that is capable of registering
I have been tasked with maintaining a legacy unmanaged c++ system. I do not

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.