java.lang.IllegalArgumentException: Could not obtain target method from JoinPoint: 'execution(void test.SecMethB())'

Spring JIRA | Anis Moussa | 6 years ago
  1. 0

    Folks , I'm not sure if this is a bug or an improvement , I initially make it as a Bug , please excuse me if this is against the Spring work as designed context. the issue is like the following : 1-I had developped an AspectJ Aspect which is suppose to match methods annotated with @RolesAllowed annotation. 2-after compiling the classes with Maven aspectJ plugin, and configuring the spring security to run in aspectj mode , the classes are weawed (compile time ). 3-the aim of enabling aspectj mode is ,to avoid going throw the proxy that the default Spring aop alliance uses , so then , internal method calls could be intercepted and not gone throw the proxy . 4-let's take a simple test case : @RolesAllowed("NON_PREMIUM_USER") public void SecMethA() { SecMethB(); } @RolesAllowed("PREMIUM_USER") public void SecMethB() { System.out.println("I'm safe, I do not need to worry "); } => if a user having the Role NON_PREMIUM_USER , and calls SecMethA(),every thing works as expected ,and the aspect is matched, than Spring security throws an accessDenied exception . but when I switch the type of SecMethB() to private , I have the below exception : java.lang.IllegalArgumentException: Could not obtain target method from JoinPoint: 'execution(void test.SecMethB())' at org.springframework.util.Assert.notNull(Assert.java:112) at org.springframework.security.access.intercept.aspectj.MethodInvocationAdapter.<init>(MethodInvocationAdapter.java:38) at org.springframework.security.access.intercept.aspectj.AspectJMethodSecurityInterceptor.invoke(AspectJMethodSecurityInterceptor.java:27) I suppose the

    Spring JIRA | 6 years ago | Anis Moussa
    java.lang.IllegalArgumentException: Could not obtain target method from JoinPoint: 'execution(void test.SecMethB())'
  2. 0

    Folks , I'm not sure if this is a bug or an improvement , I initially make it as a Bug , please excuse me if this is against the Spring work as designed context. the issue is like the following : 1-I had developped an AspectJ Aspect which is suppose to match methods annotated with @RolesAllowed annotation. 2-after compiling the classes with Maven aspectJ plugin, and configuring the spring security to run in aspectj mode , the classes are weawed (compile time ). 3-the aim of enabling aspectj mode is ,to avoid going throw the proxy that the default Spring aop alliance uses , so then , internal method calls could be intercepted and not gone throw the proxy . 4-let's take a simple test case : @RolesAllowed("NON_PREMIUM_USER") public void SecMethA() { SecMethB(); } @RolesAllowed("PREMIUM_USER") public void SecMethB() { System.out.println("I'm safe, I do not need to worry "); } => if a user having the Role NON_PREMIUM_USER , and calls SecMethA(),every thing works as expected ,and the aspect is matched, than Spring security throws an accessDenied exception . but when I switch the type of SecMethB() to private , I have the below exception : java.lang.IllegalArgumentException: Could not obtain target method from JoinPoint: 'execution(void test.SecMethB())' at org.springframework.util.Assert.notNull(Assert.java:112) at org.springframework.security.access.intercept.aspectj.MethodInvocationAdapter.<init>(MethodInvocationAdapter.java:38) at org.springframework.security.access.intercept.aspectj.AspectJMethodSecurityInterceptor.invoke(AspectJMethodSecurityInterceptor.java:27) I suppose the

    Spring JIRA | 6 years ago | Anis Moussa
    java.lang.IllegalArgumentException: Could not obtain target method from JoinPoint: 'execution(void test.SecMethB())'
  3. 0

    Bean object must not be null in Spring MVC

    Stack Overflow | 3 years ago | Sivanagaiah
    java.lang.IllegalArgumentException: Bean object must not be null
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Spring file upload by ajax

    Stack Overflow | 3 years ago | kris14an
    java.lang.IllegalArgumentException: Expected MultipartHttpServletRequest: is a MultipartResolver configured?
  6. 0

    Spring websocket encounter "Ignoring message, no principal info available" error

    Stack Overflow | 2 years ago | zizibj
    java.lang.IllegalArgumentException: No 'javax.websocket.server.ServerContainer' ServletContext attribute. Are you running in a Servlet container that supports JSR-356?

  1. batwalrus76 4 times, last 2 weeks ago
  2. serious2monkeys 1 times, last 2 weeks ago
  3. tvrmsmith 1 times, last 4 weeks ago
  4. fima 1 times, last 2 months ago
  5. dafman 2 times, last 2 months ago
8 more registered users
87 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.IllegalArgumentException

    Could not obtain target method from JoinPoint: 'execution(void test.SecMethB())'

    at org.springframework.util.Assert.notNull()
  2. Spring Core
    Assert.notNull
    1. org.springframework.util.Assert.notNull(Assert.java:112)
    1 frame
  3. spring-security-core
    AspectJMethodSecurityInterceptor.invoke
    1. org.springframework.security.access.intercept.aspectj.MethodInvocationAdapter.<init>(MethodInvocationAdapter.java:38)
    2. org.springframework.security.access.intercept.aspectj.AspectJMethodSecurityInterceptor.invoke(AspectJMethodSecurityInterceptor.java:27)
    2 frames