如何修复org.hibernate.PropertyAccessException:无法通过反射设置器设置字段值

时间:2019-07-15 07:09:22

标签: java hibernate

众所周知的代码在控制台应用程序中有效,但在启动字符串中无效。

IllegalArgumentException occurred while calling setter for property 
[by.smirnova.myweb.entity.ProductName.id (expected type = 
java.lang.Long)]; target = 
[by.smirnova.myweb.entity.ProductName@4942fb65], property value = [38]

https://github.com/Aliaksandr3by/myweb/blob/master/src/main/java/by/smirnova/myweb/entity/ProductName.java

enter image description here

1 个答案:

答案 0 :(得分:0)

该错误是由“ build.gradle”中的“ runtimeClasspath”引起的

configurations {
    developmentOnly
//  runtimeClasspath {
//        extendsFrom developmentOnly
//    }
}