UnsatisfiedDependencyException: Error creating bean with name

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'commBaseDataController': Unsatisfied dependency expressed through field 'commBaseDataService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'commBaseDataService': Unsatisfied dependency expressed through field 'commBaseDataMapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'commBaseDataMapper' defined in file [H:\idea_sevalo_workspace\HX_ERP\target\classes\com\jsh\erp\datasource2\mapper\CommBaseDataMapper.class]: Cannot resolve reference to bean 'secondarySqlSessionTemplate' while setting bean property 'sqlSessionTemplate'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'secondarySqlSessionTemplate' defined in class path resource [com/jsh/erp/config/SqlSessionTemplate2.class]: Unsatisfied dependency expressed through method 'secondarySqlSessionTemplate' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'secondarySqlSessionFactory' defined in class path resource [com/jsh/erp/config/SqlSessionTemplate2.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'secondarySqlSessionFactory' threw exception; nested exception is java.lang.NoClassDefFoundError: com/jsh/erp/datasource2/model/PurchaseStockin (wrong name: com/jsh/erp/datasource2/model/PurchaseStockIn)

Caused by: java.lang.NoClassDefFoundError: com/jsh/erp/datasource2/model/PurchaseStockin (wrong name: com/jsh/erp/datasource2/model/PurchaseStockIn)

上边是报的错,开头关键和结尾两处异常信息,查询一些相似的大多都说是因为未引入依赖问题与实体类映射出现问题

我这边就是属于与实体类映射问题,我的一个mapper的xml文件原本没有问题但是缺少与实体映射的配置,可以运行.后边其他同事在那个xml中添加了一段与实体映射的内容


加了也不会有问题,关键是他把需要大写的字母小写了,导致找不到那个实体,所以出现一系列问题

如果你有这种问题可以从上边加粗的两点出发 ,xml文件中只要写的路径对的按Ctrl是可以跳转到对应的实体的

你可能感兴趣的:(UnsatisfiedDependencyException: Error creating bean with name)