我确定在自己的类中Service只有一个实现..但是bean不唯一的错..我现在也很迷茫..用的开发工具是IDEA
求教各位大神
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'baseInfoController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.ljljob.p2p.core.base.service.ISystemDictionaryItemService com.ljljob.p2p.website.controller.BaseInfoController.systemDictionaryItemService; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [com.ljljob.p2p.core.base.service.ISystemDictionaryItemService] is defined: expected single matching bean but found 2: systemDictionaryItemServiceImpl,ISystemDictionaryItemService
spring配置如下
<!--1:配置注解解析-->
context:annotation-config/
<!--2:加载外部资源-->
<context:property-placeholder location="classpath:db.properties,classpath:sms.properties,classpath:email.properties"/>
<!--3:配置dataSource-->
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
<property name="driverClassName" value="${jdbc.driverClassName}"/>
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
</bean>
<!--4:配置sesssionFactory-->
<bean id="sqlsessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="configLocation" value="classpath:mybatis.cfg.xml"/>
<property name="mapperLocations" value="classpath:com/ljljob/p2p/*/*/mapper/*Mapper.xml"/>
<property name="typeAliasesPackage" value="com.ljljob.p2p"/>
</bean>
<!--5:配置事务管理器-->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<!--6:配置事务处理-->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="query*" read-only="true" propagation="SUPPORTS"/>
<tx:method name="select*" read-only="true" propagation="SUPPORTS"/>
<tx:method name="get*" read-only="true" propagation="SUPPORTS"/>
<tx:method name="list*" read-only="true" propagation="SUPPORTS"/>
<tx:method name="*" propagation="REQUIRED"/>
</tx:attributes>
</tx:advice>
<!--7:配置AOP-->
<aop:config>
<aop:pointcut id="txPointCut" expression="execution(* com.ljljob.p2p..service.*.*(..))"/>
<aop:advisor advice-ref="txAdvice" pointcut-ref="txPointCut"/>
</aop:config>
<!--配置mapper扫描器-->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.ljljob.p2p.core"/>
</bean>