- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我运行 spring boot 应用程序时,intellij 返回一个错误:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
org.hibernate.envers.boot.internal.TypeContributorImpl.contribute(TypeContributorImpl.java:30)
org.hibernate.boot.model.TypeContributions.contributeJavaTypeDescriptor(Lorg/hibernate/type/descriptor/java/spi/JavaTypeDescriptor;)V
jar:file:/C:/Users/romul/.m2/repository/org/hibernate/hibernate-core/5.4.6.Final/hibernate-core-5.4.6.Final.jar!/org/hibernate/boot/model/TypeContributions.class
jar:file:/C:/Users/romul/.m2/repository/org/hibernate/orm/hibernate-core/6.0.0.Alpha2/hibernate-core-6.0.0.Alpha2.jar!/org/hibernate/boot/model/TypeContributions.class
file:/C:/Users/romul/.m2/repository/org/hibernate/hibernate-core/5.4.6.Final/hibernate-core-5.4.6.Final.jar
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.produtos</groupId>
<artifactId>api-rest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>api-rest</name>
<description>Demo project for Spring Boot</description>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.0.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>12</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.8</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.26.0-GA</version>
</dependency>
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
<version>6.0.0.Alpha2</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.4.8.Final</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.4.0-b180830.0359</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
最佳答案
您不应将 Hibernate 的版本指定为 spring-boot-starter-data-jpa
依赖负责解决这个问题。
如果您运行 mvn dependency:tree | grep hibernate
,您会看到包含 2 个版本的 hibernate:
16:20 $ mvn dependency:tree | grep hibernate
[INFO] | | \- org.hibernate.validator:hibernate-validator:jar:6.0.17.Final:compile
[INFO] | +- org.hibernate:hibernate-core:jar:5.4.6.Final:compile
[INFO] +- org.hibernate.orm:hibernate-core:jar:6.0.0.Alpha2:compile
[INFO] | +- org.hibernate.common:hibernate-commons-annotations:jar:5.1.0.Final:compile
[INFO] +- org.hibernate:hibernate-entitymanager:jar:5.4.8.Final:compile
org.hibernate
改变了至
org.hibernate.orm
,这就是 Maven 没有注意到它是同一个库的原因。
hibernate-entitymanager
可以删除依赖项。
关于maven - 启动 spring boot "An attempt was made to call a method that does not exist"时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58671257/
尝试从对话框中的 EditText 获取 Edit Text 的值,但一次又一次地出现此错误 Attempt to invoke virtual method 'android.text.Editab
最近尝试了一下最新的Laravel(6.4)。正在尝试实现基于 API 的简单登录功能。没有使用 Passport 或 Tymon 的 JWT 等任何软件包。我使用了非常基本的身份验证(只需在用户表中
最近尝试了一下最新的Laravel(6.4)。正在尝试实现基于 API 的简单登录功能。没有使用 Passport 或 Tymon 的 JWT 等任何软件包。我使用了非常基本的身份验证(只需在用户表中
我在我的 PC 上运行 cifar10 网络,在完成训练和运行评估脚本后出现以下错误: 2016-06-01 14:37:14.238317: precision @ 1 = 0.000 Traceb
我正在使用 ng2-toastr 并收到以下错误 https://www.npmjs.com/package/ng2-toastr Attempt to use a destroyed view: d
env file:环境文件: APP_ENV=localAPP_DEBUG=trueAPP_KEY= ...........DB_HOST=srv3.linuxisrael.co.ilDB_D
当我登录管理员时,我正在尝试对 api 进行多重保护身份验证,我得到了跟随错误 BadMethodCallException Method Illuminate\Auth\Req uestGuard:
我开始在 Lua 中进行编程,并在运行脚本时出现此错误: attempt to index upvalue 'base' (a function value) 这可能是因为我还没有掌握一些非常基本的东
我试图在 Oozie 工作流中聚合一些数据。但是聚合步骤失败。 我在日志中发现了两个兴趣点:第一个是一个似乎重复出现的错误(?): 容器完成后,它会被杀死,但会以非零退出代码 143 退出。 它完成了
我的问题是当我调用函数时: [self performSegueWithIdentifier: @"FinalPlayPT" sender: self]; 它有效,但我有这个警告: Warning:
项目背景 项目整体采用的是springboot+mybatis 方式。有一次做数据查询的时候。console突然报:DataIntegrityViolationException: Error att
我在使用 Jobs 发送电子邮件的 Ubuntu Server 上设置了 Laravel 项目。 下面是我在 中的 laravel-worker 文件/etc/supervisor/laravel-w
尝试运行我的 React 应用程序时收到以下错误: ./src/components/App/App.js Attempted import error: 'combineReducers' is n
我的编码功能是这样的: fn encode_login(packet: &str) { let bytes = packet.as_bytes(); for (i, &element)
如果一个版本号大于另一个版本号,我的 msbuild 需要采取有条件的操作。我尝试像下面这样编写代码,但发现出现错误(也在下面)。我哪里出错了?
我是 Lua 的新手,并试图让事情在我的脑海中进行排序。我试过这个代码: function newCarousel(images) local slideToImage = function(
我正在使用 entrust用于在 Laravel 5.3 中管理基于角色的权限,并自然地为不同的用户类型使用手动/自定义登录。 Auth::attempt()可以吗?处理外表关系?基本上,我想做这样的
我谷歌了一遍又一遍,但没有对我有用的信息。 情况是这样的:1.产品有 active 。2.我通过测试账号来测试我的apk。3.我已经上传了一整天的apk。 但是当我想为应用程序中的项目付款时,goog
我正在尝试使用 groovy 解析日期字符串,但遇到了问题。这是字符串的样子和不起作用的逻辑。 def dateString = "2017-01-01T12:00:00Z" def date = D
我正在使用 ParseFacebookUtils 从 Facebook 登录我的应用。 LoginActivity 的 onCreate: protected void onCreate(Bundle
我是一名优秀的程序员,十分优秀!