No serializer found for class org.hibernate.proxy.pojo.javassist.Javassist?
Posted on
Edited on
异常
话不多说,先看异常:
1 | 1 HTTP Status 500 - Could not write content: No serializer found for class org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: java.util.ArrayList[0]->com.agen.entity.User["positionchanges"]->org.hibernate.collection.internal.PersistentSet[0]->com.agen.entity.Positionchange["position"]->com.agen.entity.Position_$$_jvst714_7["handler"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: java.util.ArrayList[0]->com.agen.entity.User["positionchanges"]->org.hibernate.collection.internal.PersistentSet[0]->com.agen.entity.Positionchange["position"]->com.agen.entity.Position_$$_jvst714_7["handler"]) |
网上找到的解决办法说是因为,hibernate会给每一个被管理的对象加上hibernateLayInitializer属性,同时structs-jsonplugin或者其他的jsonplugin都是。
因为jsonplugin用的是java的”内审机制”,hibernate会给被管理的pojo加入一个hibernateLayInitializer属性,jsonplugin通过java的反射机制将pojo解析为json时,
同时hibernateLazyInitializer属性也进行反射操作,但是hibernateLazyIniyializer无法由反射得到,所以就抛出了异常。
APlusB Solution
Posted on
Edited on
Hibernate 建表-Error executing DDL via JDBC Statement
Posted on
Edited on
Vue.js 快速入门
Posted on
Edited on
开始使用
使用Vue.js
下载
去Vue.js官网将其下载至本地,通过script 标签引入。1
<script src="js/vue.js"></script>
使用npm
npm 是一个非常有用的JavaScript 包管理工具,通过npm 可以非常迅速地使用、安装和升级Vue.js 。1
2
3
4// 安装
npm install --global vue-cli
// 测试
vue -V使用CDN
这里推荐使用Bootstrap 的CDN 加速服务,地址为https://www.bootcdn.cn。1
<script src="https://cdn.bootcss.com/vue/2.6.10/vue.common.dev.js"></script>
注:关于Vue的读法(读音 /vjuː/,类似于 view)。
熊与兔的随手记
Posted on
Edited on
。。。
application.yml 无法加载数据属性源
Posted on
Edited on
毕设错误1
1 | server: |
SQLException 时区区值无法识别
Posted on
Edited on
毕设错误2
下面这个真的是让我一头雾水,翻译了之后才理解,原来是在新版的com.mysql.jdbc.Driver这个已经被替换了,现在开始使用com.mysql.cj.jdbc.Driver,因此就要给MySQL服务器设置时区。
所以才有了接下里的错误:
1 | java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. |
SpringBoot结合Dobbo出现Error
Posted on
Edited on
如题目所属,这是我遇到的问题,以此记录一下,不说上异常:
1 | org.springframework.beans.factory.BeanCreationException: |
这个是在我写练习Demo时遇到的错误,经过反复的琢磨之后,才发现,是在引入Dubbo时,由Dubbo引入的Spring包与SpringBoot引入的Spring包发生了冲突,所以修改pom.xml文件,
排序算法
Posted on
Edited on