首先我在Spring 的applicationcontext.xml中创建了testService bean <bean id="testService" class="jobcn.model.service.impl.gzPerdotServiceImpl"> <property name="gzperdotdao"><ref local="gzperdotdao"/></property> </bean>我在我的日志文件中找到说明创建testService 成功 log:15:27:22,312 INFO SQLErrorCodesFactory:167 - Database product name found in cache {1321194}. Name is Microsoft SQL Server 15:27:22,312 INFO DefaultListableBeanFactory:158 - Creating shared instance of singleton bean 'gzperdotService' 15:27:22,312 INFO DefaultListableBeanFactory:158 - Creating shared instance of singleton bean 'testService'