spring 我用的声明式事务,在用了@Transactional(propagation=Propagation.NOT_SUPPORTED),ecache等
org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'cacheManagerFactory' must be of type [org.springframework.transaction.PlatformTransactionManager], but was actually of type [net.sf.ehcache.CacheManager]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:360)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.transaction.interceptor.TransactionAspectSupport.determineTransactionManager(TransactionAspectSupport.java:249)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:100)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
at com.oms.services.impl.OmsOrderHistoryServiceImpl$$EnhancerByCGLIB$$abfd3c38.save(<generated>)
at com.oms.services.impl.OmsDistributionRangeServiceImpl.save(OmsDistributionRangeServiceImpl.java:38)
at com.oms.services.impl.OmsDistributionRangeServiceImpl$$FastClassByCGLIB$$a52a512d.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
at com.oms.services.impl.OmsDistributionRangeServiceImpl$$EnhancerByCGLIB$$96cef88a.save(<generated>)
at com.oms.struts.action.AddressAction.save(AddressAction.java:81)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:453)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:292)
at spring ehcahe
[解决办法]
Bean named 'cacheManagerFactory' must be of type [org.springframework.transaction.PlatformTransactionManager], but was actually of type [net.sf.ehcache.CacheManager]
已经告诉你了id=cacheManagerFactory的这个bean类型不对,class应该是org.springframework.transaction.PlatformTransactionManager,而你却让class=net.sf.ehcache.CacheManager了
[解决办法]
class类型不对,import的时候弄错了吧