Announcement Announcement Module
No announcement yet.
ClassLoader.getResources() failed: Alternative parent ApplicationContext loading? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • ClassLoader.getResources() failed: Alternative parent ApplicationContext loading?

    I'm using Spring configured beans at the business and persistence layer of my app. Now I want to wire that beans together with two web application contexts so that each web application has it's own root context but only one shared (singleton) application context.

    The application is packaged as an EAR. I know that it could configured through the ContextLoaderListener in web.xml - but I'm using the Sun Application Server 7. This appserver does not load the bean configuration files (refBeanFactory.xml, ...) with EJBClassLoader.getResources() because this method is not implemented by the vendor :-( But the Spring PathMatchingResourcePatternResolver class find all resources via the ClassLoader.getResources() method.

    Are there other approaches to get a shared application context without using ClassLoader.getResources()?


  • #2
    You can use JNDI to store application contexts in a 'well known' location; see ContextJndiBeanFactoryLocator.