Hi to all:
I'm trying to migrate and old project that uses Spring 2+JavaConfig 1.0.0.m3 to Spring 3. It's an application inside a Red5 server (migrating from 0.6 to 1.0RC). After solving several issues I'm totally stucked now. I've sucessfully migrated the annotations but I think that the old behaviour is different from the actual one.
First of all, I'm not the one that created the old version, so my comments might not be totally accurate. In the old version in my opinion every method annotated with @Bean was called and therefore the bean was created. In the migrated version the behaviour seems to be different, and no method is called. My class is annotated as @Configuration for example:
The constructor is called (it's included in an xml as a bean) but the method nodeRepository it is not. Do I need any extra annotation? Is there something that I'm not understanding?Code:@Configuration public class InMemoryNodeRepositoryConfig { private static final String NET_FILE_NAME = "net.xml"; public InMemoryNodeRepositoryConfig() { System.out.println("Constructor called"); } @Bean public NodeRepository nodeRepository(final Settings systemSettings) throws Exception { System.out.println("Bean created"); final File cfgDir = Files.getConfDir(systemSettings); final String thisNodeId = systemSettings.getString(Settings.NODE_ID_KEY); final File netFile = new File(cfgDir, NET_FILE_NAME); return XmlNodeRepositoryLoader.load(thisNodeId, netFile); } }
Thanks in advance


Reply With Quote