Could not autowire.No beans of 'ItemsService' type found

Meaning is very simple, bean is not found, it is necessary in the bean module belongs, the bean either individually configured, either the open type package where annotations scanning,

  If still unresolved, focused look dependencies between your two projects those statements, such as application under

    <import resource="classpath:spring/applicationContext-dao.xml"/>
<import resource="classpath:spring/applicationContext-service.xml"/>

  Scene I encountered was dependent on the Web tier of a layer of bean Service, Service configured properly annotated scan opened, but the resource label applicationContext.xml Web layer of error, leading to the introduction of the corresponding xml file is not to reflect on later turn over the file name should be, although the issue say it very low, but really troubled for several days

  Especially in a multi-project, the main configuration file often hard to go wrong, depending on part two of the project but easy because the directory changes and to change from wrong, the mistakes do not just stare at the main configuration file to see

Guess you like

Origin www.cnblogs.com/akanga/p/11575288.html