AnsweredAssumed Answered

How to configure alfresco for Spring AOP

Question asked by amitnerkar on May 12, 2010
Latest reply on Oct 6, 2010 by cosminaru
Hi,

I have an Alfresco project already running. I needed to configure Spring AOP in Alfresco application. I have created a Spring-AOP-context.xml where all the aop configuration is done.
The Spring-AOP-context.xml is as follows:

<?xml version='1.0' encoding='UTF-8'?>

<beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:aop="http://www.springframework.org/schema/aop"
      xmlns:tx="http://www.springframework.org/schema/tx"
      xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">

   
   <!– Pointcuts –>
   <aop:config>
   <aop:pointcut id="tstPointcut"
      expression="execution(public void com.ccs.credential.web.bean.workflow.CCSProcessManageTaskDialog.init(..))" />
   <aop:advisor pointcut-ref="tstPointcut" advice-ref="testAdvice" />
   </aop:config>
   
   <!– AOP Proxy Interceptors –>
   <bean id="testAdvice" class="com.ccs.credential.metrics.CCSProcessManageTaskDialogBeforeAdvice"/>

</beans>


But whenever the application is deployed in tomcat it gives this error


INFO: Deploying web application archive alfresco.war
17:02:05,531 ERROR [web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'avmBootstrap
' defined in class path resource [alfresco/bootstrap-context.xml]: Error setting property values; ne
sted exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExcep
tions (1) are:
PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert proper
ty value of type [$Proxy43] to required type [org.alfresco.repo.avm.AVMLockingAwareService] for prop
erty 'avmLockingAwareService'; nested exception is java.lang.IllegalArgumentException: Cannot conver
t value of type [$Proxy43] to required type [org.alfresco.repo.avm.AVMLockingAwareService] for prope
rty 'avmLockingAwareService': no matching editors or conversion strategy found
Caused by:
org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessException details (1) a
re:
PropertyAccessException 1:
org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy43]
to required type [org.alfresco.repo.avm.AVMLockingAwareService] for property 'avmLockingAwareServic
e'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy43]
to required type [org.alfresco.repo.avm.AVMLockingAwareService] for property 'avmLockingAwareService
': no matching editors or conversion strategy found
Caused by:
java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy43] to required type [org.al
fresco.repo.avm.AVMLockingAwareService] for property 'avmLockingAwareService': no matching editors o
r conversion strategy found


What could be the solution? Please help.

Thanks & Regards,
Amit Nerkar

Outcomes