私はインターフェースを持っています
public interface ServiceImpl {
public List<?> getAll();
}
そしてBeanクラスがあります
public class MessageService implements ServiceImpl{
@Autowired
private SessionFactory sessionFactory;
@Override
public List<MessageItem> getAll() {
List<MessageItem> lst = sessionFactory.getCurrentSession().createQuery("from MessageItem c").list();
return lst;
}
}
Beanが作成されていません....
Bean 定義
<bean id="messageService" class="ru.apusvao.phone.model.MessageService"/>
例外
org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [ru.apusvao.phone.model.MessageService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}