Hibernate: Javassist Enhancement failed

Exception in thread "main" org.hibernate.HibernateException: Javassist Enhancement failed: com.jerryboom.cache.vo.UserModelat 
org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.getProxy(JavassistLazyInitializer.java:142)at 
org.hibernate.proxy.pojo.javassist.JavassistProxyFactory.getProxy(JavassistProxyFactory.java:71)at 
org.hibernate.tuple.entity.AbstractEntityTuplizer.createProxy(AbstractEntityTuplizer.java:631)at 
org.hibernate.persister.entity.AbstractEntityPersister.createProxy(AbstractEntityPersister.java:3737)at
org.hibernate.event.def.DefaultLoadEventListener.createProxyIfNecessary(DefaultLoadEventListener.java:360)at 
org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:281)at
org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152)at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1090)at
org.hibernate.impl.SessionImpl.load(SessionImpl.java:985)at 
org.hibernate.impl.SessionImpl.load(SessionImpl.java:978)at 
com.jerryboom.cache.CacheApp.testLazy(CacheApp.java:62)at 
com.jerryboom.cache.CacheApp.main(CacheApp.java:72)Caused by: 
java.lang.InstantiationException: com.jerryboom.cache.vo.UserModel_$$_javassist_0at 
java.lang.Class.newInstance(Unknown Source)at 
org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.getProxy(JavassistLazyInitializer.java:139)... 11 moreCaused by: java.lang.NoSuchMethodException: com.jerryboom.cache.vo.UserModel_$$_javassist_0.()at 
java.lang.Class.getConstructor0(Unknown Source)... 13 more

对应的实体类中需要添加相应的public修饰的无参构造方法

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值