123_longlong 2023-04-14 11:26 采纳率: 0%
浏览 15

com.sun.proxy.$Proxy273 cannot be cast to org.hibernate.engine.spi.SessionImplementor转换异常

spring-boot升级到导致hibernate-search不能用了,类转换异常。网上解决方案无效
解决方案1、https://blog.csdn.net/keeppractice/article/details/122556051
解决方案2、添加配置代理无效
<aop:aspectj-autoproxy proxy-target-class="true"/>
解决方案3、
template.execute(callback) 替换为template.executeWithNativeSession(callback)方法。
我项目没有用到HibernateTemplate这个对象。

img

报错代码:

img

内部报错代码

img

具体报错

img

  • 写回答

2条回答 默认 最新

  • 创意程序员 2023-04-14 17:09
    关注

    hibernate版本有做升级吗?可能版本兼容问题。

    评论

报告相同问题?

问题事件

  • 创建了问题 4月14日