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

后端 未结 9 2063
走了就别回头了
走了就别回头了 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:42

    create a DAO interface and implement the DAO interface to the SERVICE class and provide the config details of SERVICE class in the applicationContext.xml file i.e., the spring config file and access the bean using the bean id and reference the instance of the so instantiated proxy object to the DAO interface ... it will work perfectly fine ....

提交回复
热议问题