Hi,
Spring 3.0.5
Java 1.6u25
Here's a little example:
When I execute a simple unit test to see if a TestDao is returned, I get this:Code:@Component("daoFactory") public class DaoFactory { @Autowired private ApplicationContext applicationContext; public TestDao getTestDao() { return applicationContext.getBean("test", TestDaoImpl.class); } @Repository("test") public class TestDaoImpl extends AbstractDao<Model> implements TestDao { public TestDaoImpl() { super(Model.class); } @Override public Model create() { return null; } } }
In my applicationContext-testing.xml, I have this:Code:org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'test' is defined at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:527)
Any idea why the inner class isn't being autodetected and added to the BeanFactory? If I could get this solved, I could remove a chunk of duplicate code :-)Code:<context:component-scan base-package="uk.foo.bar" />
Thanks!
-=david=-


Reply With Quote
