views:

223

answers:

0

Hi,

I'm using Spring's FileSystemXmlApplicationContext in Osgi activator. Unfortunately, it doesn't load any bean from the provided XML files. I'm sure that it finds the xml configuration files, because I was testing with incorrect name of my xml configuration file, and it threw an FileNotFoundException.

Here is a snippet from my code:

    FileSystemXmlApplicationContext appContext1=new FileSystemXmlApplicationContext("classpath*:app-container-config.xml");
    System.out.println("output for file: app-container-config.xml");
    System.out.println(appContext1.getBeanDefinitionCount());
    String[] names=appContext1.getBeanDefinitionNames();
    for (int i = 0; i < names.length; i++) {
        String string = names[i];
        System.out.println(string);
    }

This code returns this:

output for file: app-container-config.xml
0

even thought I have more than 0 beans in my app-container-config.xml file.

Thanks in advance