首页 文章

mapper类的UnsatisfiedDependencyException

提问于
浏览
0

我创建了jhipster应用程序 . 当我启动应用程序时,我收到此错误:

org.springframework.beans.factory.UnsatisfiedDependencyException:在文件[/server_2/target/classes/com/test/test/service/impl/CategoryServiceImpl.class]中定义名称为'categoryServiceImpl'的bean时出错:通过构造函数表示不满意的依赖关系参数1;嵌套异常是org.springframework.beans.factory.NoSuchBeanDefinitionException:没有'com.test.test.service.mapper.CategoryMapper'类型的限定bean可用:预期至少有1个bean可以作为autowire候选者 . 依赖注释:{}

你能帮我吗?

1 回答

  • 1

    CategoryMapperImpl 是由构造时生成的,由JHipster在导入JDL文件时生成的 CategoryMapper 接口生成 CategoryMapperImpl ,确保在启动应用程序之前运行 mvnwgradlew 来生成它 .

    查看有关使用DTO的官方文档:https://www.jhipster.tech/using-dtos/

相关问题