我正在尝试将spring boot 1.5.9升级到2.0.3,服务启动失败,出现以下错误:
***************************
APPLICATION FAILED TO START
***************************
Description:
Method mvcConversionService in org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$EnableWebMvcConfiguration required a bean named 'entityManagerFactory' that could not be found.
Action:
Consider defining a bean named 'entityManagerFactory' in your configuration.
Process finished with exit code 1该服务在Spring boot 1.5.9中正常启动。
下面是yaml文件:
spring:
application:
name: customer-crud-application
datasource:
url: jdbc:jtds:sqlserver://localhost:1433;databaseName=db-data-dev
username: sa
password: pwd
driverClassName: net.sourceforge.jtds.jdbc.Driver
jpa:
show-sql: true
hibernate:
dialect: org.hibernate.dialect.SQLServer2012Dialect
server:
port: 8080
max-http-header-size: 65536和gradle.build
dependencies {
compile 'org.springframework.boot:spring-boot-starter-web'
compile versions.lombok
compile('net.sourceforge.jtds:jtds')
compile versions.spring_jdbc
compile versions.spring_boot_starter_data_jpa
}该项目是使用spring Boot2.0成功构建的,并且我已经清理了c:/Users/{user}/.m2文件夹和intelliJ缓存。请帮帮我!
发布于 2018-07-25 12:41:00
我有这个问题。当我检查maven构建日志时,我意识到有一个关于hibernate包的错误,关于
“无效的LOC报头(签名错误)”。
我通过删除下面的子目录解决了这个问题
<user-home>\.m2\repository\org\hibernate\hibernate-core and recompiling my project.发布于 2018-07-25 13:34:01
请尝试在yaml文件中进行以下更改,
spring:
jpa:
show-sql: true
database: MYSQL
hibernate:
ddl-auto: update
dialect:
storage_engine: innodb
datasource:
url: jdbc:mysql://localhost:3306/databasename?useSSL=false
username: user
password: password
server:
port: 9999快乐的编码..:)
发布于 2019-02-25 07:16:57
添加以下dep。
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>https://stackoverflow.com/questions/51509863
复制相似问题