【问题标题】:WELD (CDI) + JPA焊接 (CDI) + JPA
【发布时间】:2018-10-29 03:28:34
【问题描述】:

我尝试运行在此处找到的示例: Using CDI/Weld to Inject JPA/Hibernate Entity Managers

我得到了错误:

WELD-001408:Unsatisfied dependencies for type EntityDao<User> with qualifiers @Named at injection point [BackedAnnotatedField] @Inject @Named private com.payby.user.UserIdentityDao.baseEntityDao

我还尝试从以下位置运行示例: https://bpm.zciok.blog/2017/08/17/hibernate-cdi-example/

但我遇到了同样的错误。谁能帮我理解为什么以及如何解决它。

谢谢, 阿夫纳

【问题讨论】:

  • 请改进你的标题,它现在只是标签的组合

标签: hibernate jpa cdi weld


【解决方案1】:

对于https://bpm.zciok.blog/2017/08/17/hibernate-cdi-example/,请在 pom.xml 中做如下修改

添加persistence-api依赖

   <dependency>
            <groupId>javax.persistence</groupId>
            <artifactId>javax.persistence-api</artifactId>
            <version>2.2</version>
        </dependency>

删除范围:从依赖项提供给休眠

<dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>${version.hibernate}</version>
        <!--<scope>provided</scope>-->
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator</artifactId>
        <version>5.1.1.Final</version>
        <!--<scope>provided</scope>-->
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
        <version>${version.hibernate}</version>
        <!--<scope>provided</scope>-->
    </dependency>

【讨论】:

    猜你喜欢
    • 2013-04-30
    • 1970-01-01
    • 2013-04-26
    • 1970-01-01
    • 2021-05-03
    • 2018-01-19
    • 2018-11-24
    • 1970-01-01
    • 2018-07-26
    相关资源
    最近更新 更多