Absent Code attribute in method that is not native

从网上一搜,最有意思的解法是怪罪javaee-api 6的问题。

我们每个人面临的问题都不一样,难道删除javaee-api 6就是万能钥匙?

javaee-api 依赖配置:

<dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>6.0</version>
            <scope>provided</scope>
            <!--  <scope>compile</scope>-->
        </dependency>

而正如摘要上所示的异常:

javax/persistence/PersistenceException

我们只需要添加persistence-api就可以解决了;

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



你可能感兴趣的:(java,exception)