Pregunta

I have a simple (ant based) test based on AbstractTransactionalTestNGSpringContextTests. I get an error complaining no suitable bean found for auto wiring.

@Autowired
@Qualifier("userSessionDao")
private UserSessionDAO userSessionDao;

The DAO:

@Repository("userSessionDao")
public class UserSessionDAOImpl extends
    AbstractGenericDAOImpl<UserSession, Long> implements UserSessionDAO {
/**
 * 
 */
@SuppressWarnings("unused")
private XLogger logger = XLoggerFactory.getXLogger(UserSessionDAOImpl.class
        .getName());

}

I have the following in the config.xml: < context:component-scan base-package="com.blah" />

Am I missing a step to make component-scan kick in?

¿Fue útil?

Solución

Try <context:component-scan base-package="com.blah.*" />

Also, check that UserSessionDAO is an autowired candidate.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top