Results 1 to 2 of 2

Thread: Multiple init sequences in a web application

  1. #1
    Join Date
    Sep 2004
    Posts
    4

    Default Multiple init sequences in a web application

    Hi,

    The system I'm working on is built of a single web application that includes 3 disconnected subsystems.

    The system bootstrap consists of a ContextLoaderListener that loads all context files.

    The context structure is such that there is one common context file + 3 context files that rely on that context file but are decoupled.

    Therefore, if there is any problem loading either of the subsystems context files the whole initialization sequence fails and the whole web application down together with the subsystems that could run successfully.

    What I'd like to achieve is that once the common context file loads, the other three each could succeed or fail without failing the whole web application (so it will be possible to work on whichever succeeded). This is especially important when multiple developers are working on an unstable system as it develops.

    Since there is a common contextConfigLocation parameter I couldn't find a way to supply multiple of them. I tried switching to ContextServletListener (which at least doesn't fail the webapp) but still couldn't find a way to have 3 different of them.

    Thanks.

  2. #2
    Join Date
    Feb 2005
    Location
    Boston, MA
    Posts
    1,142

    Default

    There is no multiple parents in the ApplicationContext hierarchy, so you would have to specify all 3 context files in one context. However, you might consider writing a custom version of ClassPathXmlApplicationContext that allows any one of the specified locations to fail to load and not have the whole context fail.

    The problem with that will be however, that any dependencies from the web application will fail if they can't find the missing objects in the other context. They way around that is to use lazy-init in your web application's context so as long as you don't touch the page which ultimately refers to the missing object in the failed component context, you should be fine.

Similar Threads

  1. Replies: 1
    Last Post: Dec 19th, 2007, 03:21 PM
  2. Replies: 5
    Last Post: Oct 8th, 2006, 12:39 PM
  3. Replies: 8
    Last Post: Jun 9th, 2005, 10:02 AM
  4. Stack Overflow
    By rayho222 in forum Container
    Replies: 6
    Last Post: May 17th, 2005, 03:42 AM
  5. Questioning the core component
    By Martin Kersten in forum Swing
    Replies: 6
    Last Post: Feb 21st, 2005, 03:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •