hibernate javassist jar包重复的错误

124 篇文章 1 订阅
96 篇文章 0 订阅

今天遇到一个hibernate jar包重复的错误,导致查询的时候报错如下:

[main] ERROR org.hibernate.proxy.pojo.javassist.JavassistProxyFactory - HHH000142: Javassist Enhancement failed: domain.Customer

解决方法: 删除其中一个就可以了,希望可以帮助到遇到此问题的朋友。

 

 

报错图


Hibernate: 
    select
        linkman0_.lkm_id as lkm_id1_1_,
        linkman0_.lkm_name as lkm_name2_1_,
        linkman0_.lkm_gender as lkm_gend3_1_,
        linkman0_.lkm_phone as lkm_phon4_1_,
        linkman0_.lkm_mobile as lkm_mobi5_1_,
        linkman0_.lkm_email as lkm_emai6_1_,
        linkman0_.lkm_qq as lkm_qq7_1_,
        linkman0_.lkm_position as lkm_posi8_1_,
        linkman0_.lkm_memo as lkm_memo9_1_,
        linkman0_.lkm_cust_id as lkm_cus10_1_ 
    from
        cst_linkman linkman0_
15:39:34.154 [main] ERROR org.hibernate.proxy.pojo.javassist.JavassistProxyFactory - HHH000142: Javassist Enhancement failed: domain.Customer
java.lang.ClassCastException: domain.Customer_$$_javassist_1 cannot be cast to javassist.util.proxy.Proxy
	at org.hibernate.proxy.pojo.javassist.JavassistProxyFactory.getProxy(JavassistProxyFactory.java:123) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
	at org.hibernate.tuple.entity.AbstractEntityTuplizer.createProxy(AbstractEntityTuplizer.java:666) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
	at org.hibernate.persister.entity.AbstractEntityPersister.createProxy(AbstractEntityPersister.java:4462) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
	at org.hibernate.event.internal.DefaultLoadEventListener.createProxyIfNecessary(DefaultLoadEventListener.java:359) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
	at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:274) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
	at org.hibernate.event.internal.DefaultLoadEventListener.doOnLoad(DefaultLoadEventListener.java:121) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
	at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:89) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
	at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1129) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
	at org.hibernate.internal.SessionImpl.internalLoad(SessionImpl.java:1022) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
	at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:632) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
	at org.hibernate.type.EntityType.resolve(EntityType.java:424) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
	at org.hibernate.engine.internal.TwoPhaseLoad.doInitializeEntity(TwoPhaseLoad.java:154) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
	at org.hibernate.engine.internal.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:128) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
	at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:1132) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
	at org.hibernate.loader.Loader.processResultSet(Loader.java:992) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
	at org.hibernate.loader.Loader.doQuery(Loader.java:930) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:336) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
	at org.hibernate.loader.Loader.doList(Loader.java:2611) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
	at org.hibernate.loader.Loader.doList(Loader.java:2594) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2423) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
	at org.hibernate.loader.Loader.list(Loader.java:2418) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
	at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:501) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
	at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:371) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
	at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:216) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
	at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1326) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
	at org.hibernate.internal.QueryImpl.list(QueryImpl.java:87) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
	at dao.linkmanDaoImpl.findAll(linkmanDaoImpl.java:29) [classes/:?]
	at test.Demo1.demo6(Demo1.java:41) [classes/:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_77]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_77]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_77]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_77]
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) [junit-4.9.jar:?]
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) [junit-4.9.jar:?]
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) [junit-4.9.jar:?]
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) [junit-4.9.jar:?]
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) [junit-4.9.jar:?]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:69) [junit-4.9.jar:?]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48) [junit-4.9.jar:?]
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) [junit-4.9.jar:?]
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) [junit-4.9.jar:?]
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) [junit-4.9.jar:?]
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) [junit-4.9.jar:?]
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) [junit-4.9.jar:?]
	at org.junit.runners.ParentRunner.run(ParentRunner.java:292) [junit-4.9.jar:?]
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) [.cp/:?]
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) [.cp/:?]
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538) [.cp/:?]
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760) [.cp/:?]
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460) [.cp/:?]
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206) [.cp/:?]

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值