Announcement Announcement Module
Collapse
No announcement yet.
Can application context display more than 1 error at once? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can application context display more than 1 error at once?

    Is it possible for an applicatioon context that has an invalid configuration to display multiple errors at once rather than only a single error? What I would like to do is, assuming the XML file has a valid format, figure out *each* bean that is invalid and display *all* of those beans.

    If it is not possible, how would you suggest I go about implementing such functionality, and would the Spring team be interested in including this functionality in the Spring core? I can certainly write it and implement it.

    My use case is this:
    - We allow users to define multiple databases, one of which is chosen when the user logs in (kind of like Apache's BugZilla or Rational's ClearQuest). We are building a GUI that allows users to graphically add databases which our app internally stores in a Spring application context. We would like to aggregate all the problems with the databases in the application context at once. This would be useful to detect, for example, if the network was down vs. just a single database is down.

    I was thinking perhaps a new interface would be beneficial. Maybe

    DebuggableApplicationContext extends ConfigurableApplicationContext {
    /** Returns a Map of bean names to exceptions that lists the problems that would be encountered if the application context were to have its refresh() method called */
    Map testBeanDefinitions();
    }

  • #2
    Interesting idea. Probably best to discuss on the Spring Developer mailing list.

    There are certainly some technical challenges here, as one failure may make it impossible to even attempt to initialize other beans. But it may be possible to continue in some circumstances.

    Rgds
    Rod

    Comment


    • #3
      Originally posted by Rod Johnson
      Probably best to discuss on the Spring Developer mailing list.
      Thanks Rod... will post there...

      Comment

      Working...
      X