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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:27:06+00:00 2026-05-11T22:27:06+00:00

Just to keep my sanity, I’m telling Spring to barf on circular references: _context

  • 0

Just to keep my sanity, I’m telling Spring to barf on circular references:

    _context = new ClassPathXmlApplicationContext(getApplicationContextFiles(), false);
    _context.setAllowCircularReferences(false);
    _context.refresh();
    _context.start();

The problem is that the resulting stack trace actually does look like barf 😐

How can I get a simple output of a circular references, similar to:

Unresolved circular reference: [aBean->nextBean->otherBean->aBean]

?

  • 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-11T22:27:07+00:00Added an answer on May 11, 2026 at 10:27 pm

    If all your cycles are between registered components this may help (as far as I can recall you can’t reference inner beans easily as they are not registered).
    You can register a custom listener on events generated by the bean parsers, to do so extend the application context and override initBeanDefinitionReader(), in that method set your custom listener on the beanDefinitionReader using setEventListener (you’ll need to cast to XmlBeanDefinitionReader).

    The listener will be notified when ComponentDefinitions are registered and store them in a Map.
    Once processing of the configuration is complete, you can then process the ComponentDefinitions to identify cycles using something similar to JDepend‘s jdepend.framework.JavaPackage..
    For each ComponentDefinition, iterate the getBeanDefinitions() and getBeanReferences() (and maybe getInnerBeanDefinitions()) and add create a “JavaPackage” for each definition and a dependency for each reference.
    After processing each reference and declaration, you can then interrogate the JavaPackage-like objects and spit out the results of any that return true for containsCycle()

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

Sidebar

Related Questions

People keep telling me instead of writing shift 1 bit to the left, just
Maybe I should just keep my mouth shut and move forward, but something tells
Well, just to keep it simple: I have a webform. On it a button
I just started getting into BizTalk at work and would love to keep using
The IT lady just gave me a laptop to keep! I've always wanted to
I keep reading about people who are test infected, meaning that they don't just
I'm just wondering what others do in this respect: Do you try to keep
I've just started programming in Assembly for my computer organization course, and I keep
I was wondering if there is some option to keep ReSharper from removing just
I just keep getting this error: Method js is not defined neither in controller,

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.