错误::“使用名称创建bean时出错”在春季[关闭]

问题描述 投票:-5回答:1
**狂蝇服务器日志:: **org.springframework.beans.factory.UnsatisfiedDependencyException:创建名称为'customerController'的bean时出错:通过字段'customerService'表示的不满足的依赖关系;由以下原因引起:java.lang.RuntimeException:org.springframework.beans.factory.UnsatisfiedDependencyException:创建名称为'customerController'的bean时出错:通过字段'customerService'表示的不满足的依赖关系;嵌套的异常是org.springframework.beans.factory.NoSuchBeanDefinitionException:Spring Service实现代码::

package com.edifixio.training.service; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.edifixio.training.dao.CustomerDAO; import com.edifixio.training.entity.Customer; @Service public class CustomerServiceImpl { @Autowired private CustomerDAO customerDAO; @Transactional public List < Customer > getCustomers() { return customerDAO.getCustomers(); } @Transactional public void saveCustomer(Customer theCustomer) { customerDAO.saveCustomer(theCustomer); } @Transactional public Customer getCustomer(int theId) { return customerDAO.getCustomer(theId); } @Transactional public void deleteCustomer(int theId) { customerDAO.deleteCustomer(theId); } }

java spring spring-mvc spring-data-jpa spring-jdbc
1个回答
1
投票
错误的相关部分是:
© www.soinside.com 2019 - 2024. All rights reserved.