Announcement Announcement Module
Collapse
No announcement yet.
JoinPoint getArgs() return null Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JoinPoint getArgs() return null

    Aspect works well, but why the method joinPoint.getArgs () returns a null? What is the reason? How to fix it? Standalone version works correctly, but when using Jetty always returns null. I use Spring 3.2, Spring Security.

    Code:
    In config Spring: <aop:aspectj-autoproxy/>
    
    @Validated
    public interface Service {
    
        public String update(Long userId, String name);
    
    }
    
    
    @Service("myService")
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public class ServiceImpl implements Service {
    
        @MyAnnotation
        @Override    
        public String update(Long userId, String name) {
    
         //...
        }
    
    }
    
    @Aspect
    @Component
    public class MyAspect {                   
    
        @Around("@annotation(annotation)")
        public Object myAround(ProceedingJoinPoint joinPoint, MyAnnotation annotation)                                    throws Throwable {
    
            Object[] args = joinPoint.getArgs();            
            args = null!
        }
    }
    Object [] args = joinPoint.getArgs(); log.info ("Args {}", args);
    Show only first argument, which was null.
    Closed!
    Last edited by rdm; Aug 30th, 2013, 10:58 AM.
Working...
X