小编Ukr*_*nis的帖子

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:SpringBoot“字段列表”中的未知列“city0_.country_code”

尝试使用 Gradle 创建一个简单的 SpringBoot 应用程序 - Api with DataBase。当尝试使用 api 调用从表中获取数据时,在 Postman 中出现异常:

{
    "timestamp": "2018-04-01T12:45:40.218+0000",
    "status": 500,
    "error": "Internal Server Error",
    "message": "could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet",
    "path": "/api/demo/towns"
}
Run Code Online (Sandbox Code Playgroud)

在有下一个例外的想法中:

2018-04-01 15:44:29.553错误17532 --- [nio-8080-exec-2] ohengine.jdbc.spi.SqlExceptionHelper:“字段列表”中的未知列“city0_.country_code”2018-04-01 15 :44:29.578 ERROR 17532 --- [nio-8080-exec-2] oaccC[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] 在路径 [] 的上下文中抛出异常 [请求处理失败;嵌套异常是 org.springframework.dao.InvalidDataAccessResourceUsageException:无法提取 ResultSet;SQL [不适用];嵌套异常是 org.hibernate.exception.SQLGrammarException: 无法提取 ResultSet] 其根本原因

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:sun.reflect.NativeConstructorAccessorImpl.newInstance0(本机方法)〜[na:1.8.0_144]在sun.reflect.NativeConstructorAccessorImpl的“字段列表”中未知列“city0_.country_code” .newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_144] 在 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_144] 在 java.lang.reflect.Constructor.newInstance (Constructor.java:423) ~[na:1.8.0_144] 在 …

java mysql entity hibernate spring-boot

0
推荐指数
1
解决办法
2395
查看次数

标签 统计

entity ×1

hibernate ×1

java ×1

mysql ×1

spring-boot ×1