cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajagopal Chowdary Yendluri <rajagopal.yendl...@gmail.com>
Subject CXF With Spring AOP is not working.
Date Wed, 13 Mar 2013 15:50:50 GMT
Hi,


Here is the scenario i am trying.

1. when an exception thrown from a web service i want to invoke an aspect
which is sending a mail to a mailing list.

Here is the steps which i tried.

1. Added AspectJ support in applicaiton context by adding the following
line.

              *<aop:aspectj-autoproxy/>*

2.  Written a new Aspect as following:


@Aspect
@Component
public class ExceptionMailer{

@AfterThrowing(pointcut="execution(* com.mycompany.*..impl.*.*(..))",
throwing ="ex")
public void sendExceptionMail(JoinPoint joinPoint) {
System.out.println(" Sending Email .....................again ");
}
}


3. Here is my WebService class.

package com.mycompany.common.services.impl;
@WebService(endpointInterface =
"com.mycompnay.common.services.UserService",serviceName="UserDetails")
@Service
public class UserServiceImpl implements UserService {

public List<User> getUserDetails(String userId) throwsException {

try {
                        throw new Exception("Msg Exception ....");
 } catch (Exception e) {
throw new Exception("xcepiton");
}
}
 @PostConstruct
public void init() {
    SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
}
}

When i create a seperate project  with the same pointcout and with the same
package structure it is working good, but not with CXF.

Is there any way / we need to tell CXF, that i am using AspectJ AOP.
It is not throwing any exception, it is silently ignoring the Aspect.


-- 
Regards,
Rajagopal Yendluri(Raj)

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message