Spring   发布时间:2022-04-09  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了java – Spring中的UnsatisfiedDependencyException:构造函数的非法参数:参数类型不匹配大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

我正在尝试在Departmentservice中注入DepartmentDAO.这是在我添加@transactional注释后出现的.所以这是我的Departmentservice:

@service
@transactional
public class Departmentservice extends AbstractCRUDservicesuper();
        this.departmentDAO = null;
    }

    @Inject
    public Departmentservice(DepartmentDAO departmentDAO) {
        super();
        this.departmentDAO = departmentDAO;
    }

    @Override   
    public Long create(DepartmentDTO dDTO) {        
        Department department = new Department();
        department.setDepName(dDTO.getDepName());
        return departmentDAO.create(department);
    }
...............read,update,delete,findAll methods...........................
}

这是我的部门DAO:

@Repository
@transactional(propagation = Propagation.MANDATORY)
public class DepartmentDAO extends AbstractCRUDDao

这是一个applicationContext.xml:

http://www.springframework.org/scheR_425_11845@a/beans" xmlns:context="http://www.springframework.org/scheR_425_11845@a/context" xmlns:xsi="http://www.w3.org/2001/XMLscheR_425_11845@a-instance" xmlns:tx="http://www.springframework.org/scheR_425_11845@a/tx" xsi:scheR_425_11845@aLOCATIOn="
    http://www.springframework.org/scheR_425_11845@a/beans
    http://www.springframework.org/scheR_425_11845@a/beans/@R_301_884@s-3.0.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-3.0.xsd
    http://www.springframework.org/schema/tx
    http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
    ">

<>fig />
本图文内容来源于网友网络收集整理提供,作为学习参使用,版权属于原作者。

大佬总结

以上是大佬教程为你收集整理的java – Spring中的UnsatisfiedDependencyException:构造函数的非法参数:参数类型不匹配全部内容,希望文章能够帮你解决java – Spring中的UnsatisfiedDependencyException:构造函数的非法参数:参数类型不匹配所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。