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

The Archive Base Latest Questions

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

Here is my xml config: <bean id=diameterClient class=com.rory.ptspsim.diameterclient.DiameterClient scope=singleton init-method=start> <constructor-arg index=0><value>${pcca.host}</value></constructor-arg> <constructor-arg index=1><value>${pcca.port}</value></constructor-arg>

  • 0

Here is my xml config:

<bean id="diameterClient" class="com.rory.ptspsim.diameterclient.DiameterClient" scope="singleton" init-method="start">
    <constructor-arg index="0"><value>${pcca.host}</value></constructor-arg>      
    <constructor-arg index="1"><value>${pcca.port}</value></constructor-arg>      
    <constructor-arg index="2" value="com.rory.djgx.message"/>
    <constructor-arg index="3" value="com.rory.djgx.avp"/> 
    <constructor-arg index="4">
    <list>
        <ref bean="asrHandler"/>
        <ref bean="aaaHandler"/>
        <ref bean="ceaHandler"/>
        <ref bean="dwaHandler"/>
        <ref bean="staHandler"/>
    </list>
    </constructor-arg> 
</bean>

<bean id="asrHandler" class="com.rory.ptspsim.messagereceivers.ASRHandler"/>
<bean id="aaaHandler" class="com.rory.ptspsim.messagereceivers.AAAHandler"/>
<bean id="ceaHandler" class="com.rory.ptspsim.messagereceivers.CEAHandler"/>
<bean id="dwaHandler" class="com.rory.ptspsim.messagereceivers.DWAHandler"/>
<bean id="staHandler" class="com.rory.ptspsim.messagereceivers.STAHandler"/>

And here is the start of the ASRHandler class:

public class ASRHandler implements DiameterMessageHandler
{   
    @Autowired
    private DiameterClient diameterClient;

Does anyone have any idea why this isnt working? I realise the the handler class and the DiameterClient class have a dependancy on each other, but I though Spring took care of that.

Here is the message from the log:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘diameterClient’ defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference to bean ‘asrHandler’ while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘asrHandler’: Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name ‘diameterClient’: Requested bean is currently in creation: Is there an unresolvable circular reference?

Thanks!

  • 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-30T09:18:15+00:00Added an answer on May 30, 2026 at 9:18 am

    This is most certainly a circular dependency. You should be seeing a BeanCurrentlyInCreationException thrown by Spring.

    Beans cannot be referenced when they are being instantiated already. The issue is that you are using constructor injection to create your beans.

    I see two things that should be able to fix this.

    1. Based on the package name of DiameterClient I am assuming it is a class that you are in control of. I would recommend autowiring all dependencies of that class as you have with your xxxHandler classes. You should even be able to @Autowired a List<DiameterMessageHandler>, and Spring will load all beans that implement that interface into the list.
    2. Use property based injection on your beans (instead of the constructor-arg element, use the property element).

    EDIT:

    If you have your files looks something like this:

    <bean id="diameterClient" class="com.rory.ptspsim.diameterclient.DiameterClient" scope="singleton" init-method="start"/>
    
    <bean id="asrHandler" class="com.rory.ptspsim.messagereceivers.ASRHandler"/>
    <bean id="aaaHandler" class="com.rory.ptspsim.messagereceivers.AAAHandler"/>
    <bean id="ceaHandler" class="com.rory.ptspsim.messagereceivers.CEAHandler"/>
    <bean id="dwaHandler" class="com.rory.ptspsim.messagereceivers.DWAHandler"/>
    <bean id="staHandler" class="com.rory.ptspsim.messagereceivers.STAHandler"/>
    

    and this:

    public class DiameterClient {
        @Autowired
        private List<DiameterMessageHandler> handlers;
    
        @Value("${pcca.host}")
        private String host;
    
        @Value("${pcca.port}")
        private int port; // or String...
    
        // I don't know what these other two would be...if they are autowired, or just values you would populate...
        private String somePackage;
    
        private String anotherPackage;
    
        // methods go here...
    }
    

    then the List<DiameterMessageHandler> would contain the 5 beans you have defined under your diameterClient bean in your xml. If order is important, you may need to specify them in your context in a specific order, but otherwise it should just work.

    You could even take this further and annotate your classes with a Stereotype annotation (@Component most likely) and do a context:component-scan on the packages that contain these classes. That would mean even less xml declaration.

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

Sidebar

Related Questions

my web.xml config is <filter> <filter-name>springSecurityFilterChain</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> </filter> <filter-mapping> <filter-name>springSecurityFilterChain</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> here is
Here is part of my web.xml: <context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath:application-config.xml </param-value> </context-param> application-config.xml uses
Here is the web.config; <?xml version=1.0 encoding=UTF-8?> <configuration> <system.web> <customErrors mode=Off> </customErrors> <authentication mode=Forms>
I configure a flow in mule-config.xml based on the documentation( click here ). Here
Here is my bean.xml <?xml version=1.0 encoding=UTF-8?> <beans xmlns=http://www.springframework.org/schema/beans xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:context=http://www.springframework.org/schema/context xmlns:p=http://www.springframework.org/schema/p xmlns:tx=http://www.springframework.org/schema/tx xsi:schemaLocation=
Previously I have created a method updateRecord() in com.TestTransaction class. The updateRecord() method has
Here is my situation: I have my mvc-config.xml file for my web service set
Here's the XML file i'm working on: <list> <activity>swimming</activity> <activity>running</activity> <activity>soccer</activity> </list> The index.php,
Here's the XML code I'm working with: <inventory> <drink> <lemonade supplier=mother id=1> <price>$2.50</price> <amount>20</amount>
Here is my XML Response: <DIDL-Lite xmlns=urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/ xmlns:dc=http://purl.org/dc/elements/1.1/ xmlns:upnp=urn:schemas-upnp-org:metadata-1-0/upnp/ <item id=1182 parentID=40 restricted=1> <title>Hot

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.