Bug之反序列化nested exception is org.hibernate.type.SerializationException

版权声明:转载请标明原作者及地址 https://blog.csdn.net/cauchy6317/article/details/83988977

异常信息:

org.springframework.orm.jpa.JpaSystemException: could not deserialize; nested exception is org.hibernate.type.SerializationException: could not deserialize...

Caused by: org.hibernate.type.SerializationException: could not deserialize...

Caused by: java.lang.ClassNotFoundException: cn.eastsoft.privilege.bean.MTable...

背景:项目需要修改项目名,包名。将cn.eastsoft 改成com.eastsoft.subject.som

在idea中修改了项目名以后启动程序,进入login页面后,输入账号密码,点击登录。后台出现了错误,下面贴出报错截图。

反序列化错误,可以看得出来这个实体类还是去找了之前的包下面实体。我用了自己之前的实体类测试(该实体类的表不与其它表有交集)。在我改了项目名后,很正常。然后我百度了一下,也是说有表之间的级联关系发生错误。然后我就仔细研究了一下这个报错信息的错误,发现这里面的实体类Module和Mtable存在这级联关系,module是一,mtable是多。

然后我在Module中加入了@ManyToOne

然后就行了。。。哈哈哈

对了还要改了pom文件的groupId

点赞关注,谢谢小伙伴们。最新关注的前100名,我会义务帮你的呀!

猜你喜欢

转载自blog.csdn.net/cauchy6317/article/details/83988977