Announcement Announcement Module
No announcement yet.
More than one applicationContext.xml in many Jar-Files Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • More than one applicationContext.xml in many Jar-Files

    We use Spring on our EJB:
    public class ExampeEJB extends AbstractStatelessSessionBean implements Example {

    private Example delegate;

    protected void onEjbCreate() throws CreateException {
    this.delegate = (Example) getBeanFactory().getBean("example", Example.class);

    We have set the BeanFactoryPath in ejb-jar.xml


    But now we have the Problem, that there are many EJB-jar-Files in our EAR-File. Everey EJB-Jar-File includes an individual applicationContextEJB.xml.
    And now the problem is, if the BeanFactoryLocator search the applicationcontextEJB.xml it will found any applicationContextEJB.xml, but not this who is in this jar-file.
    How can i say wich Classloader the ContextJNDIBeanFactoryLocator must use, or an Class that can it use to get the Classloader?
    Or why doesn`t I say which file he must use, for example:

    factory = new XmlBeanFactory(new InputStreamResource(is));

    Thanx for help

  • #2
    I also suffer from same problem. What is best approach to follow in order to resolve that problem?


    • #3
      more than one applicationContext

      you can use SingletonBeanFactoryLocator instead for loading several ApplicationContexts .