Fixing BeanNotOfRequiredTypeException on Spring proxy cast on a non-singleton bean?

后端 未结 9 2053
走了就别回头了
走了就别回头了 2020-12-05 06:59

I\'m having an issue with pulling a Spring bean from an application context.

When I try;

InnerThread instance = (InnerThread) SpringContextFactory.g         


        
9条回答
  •  抹茶落季
    2020-12-05 07:38

    I had this issue even though I referenced CGLIB and used the proxy-target-class="true" setting. I determined ehcache:annotation tag was to blame... Removing the following configuration solved this for me. Fortunately, I was able to use hibernate level 2 caching instead of having to use ehcache declarative caching.

    
        
        
     
    

提交回复
热议问题