SpringMVC项目中使用了mybatis作为数据库访问层,今天做了个新表,仿照原有逻辑写好mapper层及service层代码之后,
使用ClassPathXmlApplicationContext.getBean()尝试获取mapper bean一直报错如下:
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webloadDetailGeneratorWriteMapper': Post-processing of the FactoryBean's object failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class com.sun.proxy.$Proxy37]: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: Cannot subclass final class class com.sun.proxy.$Proxy37
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:167)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.get