Hi, The SMX 4.x is an OSGi container basically so it use use very different classloader mechanism with SMX 3.x. This error means can't cast org.aopalliance.intercept.MethodInterceptor to org.aopalliance.aop.Advice, this generally means org.aopalliance.intercept.MethodInterceptor and org.aopalliance.aop.Advice are loaded from different classloaders. In SMX 4.x we install aopalliance bundle for the container OOTB, but your SA also include aopalliance-1.0.jar, this is the problem. You need remove aopalliance-1.0.jar from your SA, and add <classpath> <library>osgi:org.apache.servicemix.bundles.aopalliance</library> </classpath>
for your SU xbean.xml, this way your SA/SU can use aopalliance bundle from the container level, take a look at [1] to get more details, the "New in ServiceMix 4.2.0" chapter. [1]http://servicemix.apache.org/classloaders.html Freeman ------------- Freeman Fang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://fusesource.com | http://www.redhat.com/ Twitter: freemanfang Blog: http://freemanfang.blogspot.com http://blog.sina.com.cn/u/1473905042 weibo: http://weibo.com/u/1473905042 On 2012-10-9, at 上午1:40, srini wrote: > Hi, I am facing issues with migrating servicemix3 SA (JBI based) to > servicemix 4.4.2. > > Servicemix4 is throwing errors while loading Spring configurations of an SU > whch is using interceptors. > Error: Error creating bean with name 'retryInterceptor' defined in URL > [file:C:/spring-config.xml]: Initialization of bean failed; nested exception > is org.springframework.beans.ConversionNotSupportedException: Failed to > convert property value of type 'my.DAOInterceptor' to required type > 'org.aopalliance.aop.Advice' for property 'advice'; nested exception is > java.lang.IllegalStateException: Cannot convert value of type > [my.DAOInterceptor] to required type [org.aopalliance.aop.Advice] for > property 'advice': no matching editors or conversion strategy found > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) > > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) > > > Additional Details: > 1. I am trying to deploy smx3 SA(zip file) as-is after installing JBI > feature in smx4. > 2. my.DAOInterceptor is implementing > org.aopalliance.intercept.MethodInterceptor; > 3. Configuration in spring-config.xml: > <bean id="retryDAOInterceptor" class="my.DAOInterceptor"/> > <bean id="retryInterceptor" > class="org.springframework.aop.support.RegexpMethodPointcutAdvisor"> > <property name="advice" ref="retryDAOInterceptor"/> > <property name="pattern"> > <value>.*</value> > </property> > </bean> > > --my.DAOInterceptor is implementing > org.aopalliance.intercept.MethodInterceptor. > 4. Project is using spring 2.5.6. I have tried with spring 3.0.6 but getting > same error. > 5. It does not appear to be an issue with multiple jars in classpath, as > removing aopalliance-1.0.jar from the SA is resulting in ClassNotFound > exception during deployment. > 6. The same SA deploys successfully in smx3.3 > > Any help would be greatly appreciated. > > > > -- > View this message in context: > http://servicemix.396122.n5.nabble.com/Failed-to-convert-property-value-to-required-type-org-aopalliance-aop-Advice-for-property-advice-tp5714672.html > Sent from the ServiceMix - User mailing list archive at Nabble.com.
