Announcement Announcement Module
Collapse
No announcement yet.
More than one applicationContext.xml in many Jar-Files Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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

    <env-entry>
    <env-entry-name>ejb/BeanFactoryPath</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>applicationContextEJB.xml
    </env-entry-value>
    </env-entry>

    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:

    is=this.getClass().getResourceAsStream"/conf/applicationContext.xml");
    factory = new XmlBeanFactory(new InputStreamResource(is));

    Thanx for help
    Christian

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

    Comment


    • #3
      more than one applicationContext

      you can use SingletonBeanFactoryLocator instead for loading several ApplicationContexts .

      Comment

      Working...
      X