UnsupportedPointcutPrimitiveException

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

UnsupportedPointcutPrimitiveException

Mohan Radhakrishnan-2
Hi,
             This should be supported. Isn't it. I use Spring Tool Suite and @EnableAspectJAutoProxy

Thanks,
Mohan

@Pointcut("execution(* com.pearson.nextgen.enterprise.service.CourseService.getCoursesByInstitutionId(String)) && if()")
    public static boolean courseSearch() {
    return Boolean.getBoolean( mockOrNot.get() ); 
    }


Caused by: org.aspectj.weaver.tools.UnsupportedPointcutPrimitiveException: Point
cut expression 'execution(* com.pearson.nextgen.enterprise.service.CourseService
.getCoursesByInstitutionId(String)) && if()' contains unsupported pointcut primi
tive 'if'
        at org.aspectj.weaver.tools.PointcutParser.validateAgainstSupportedPrimi
tives(PointcutParser.java:435)
        at org.aspectj.weaver.tools.PointcutParser.validateAgainstSupportedPrimi
tives(PointcutParser.java:413)
        at org.aspectj.weaver.tools.PointcutParser.resolvePointcutExpression(Poi
ntcutParser.java:311)
        at org.aspectj.weaver.reflect.InternalUseOnlyPointcutParser.resolvePoint
cutExpression(InternalUseOnlyPointcutParser.java:36)
        at org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate
.getDeclaredPointcuts(Java15ReflectionBasedReferenceTypeDelegate.java:307)
        at org.aspectj.weaver.ReferenceType.getDeclaredPointcuts(ReferenceType.j
ava:884)

_______________________________________________
aspectj-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users
Reply | Threaded
Open this post in threaded view
|

Re: UnsupportedPointcutPrimitiveException

Andy Clement
I don’t honestly know about Spring AOP and using if() like that. From the documentation:


That lists the supported designators and if() is not on the list I’m afraid.

Could be worth asking on stack overflow about how to achieve what you want in Spring AOP.

cheers,
Andy

On Sep 19, 2016, at 6:42 AM, Mohan Radhakrishnan <[hidden email]> wrote:

Hi,
             This should be supported. Isn't it. I use Spring Tool Suite and @EnableAspectJAutoProxy

Thanks,
Mohan

@Pointcut("execution(* com.pearson.nextgen.enterprise.service.CourseService.getCoursesByInstitutionId(String)) && if()")
    public static boolean courseSearch() {
    return Boolean.getBoolean( mockOrNot.get() ); 
    }


Caused by: org.aspectj.weaver.tools.UnsupportedPointcutPrimitiveException: Point
cut expression 'execution(* com.pearson.nextgen.enterprise.service.CourseService
.getCoursesByInstitutionId(String)) && if()' contains unsupported pointcut primi
tive 'if'
        at org.aspectj.weaver.tools.PointcutParser.validateAgainstSupportedPrimi
tives(PointcutParser.java:435)
        at org.aspectj.weaver.tools.PointcutParser.validateAgainstSupportedPrimi
tives(PointcutParser.java:413)
        at org.aspectj.weaver.tools.PointcutParser.resolvePointcutExpression(Poi
ntcutParser.java:311)
        at org.aspectj.weaver.reflect.InternalUseOnlyPointcutParser.resolvePoint
cutExpression(InternalUseOnlyPointcutParser.java:36)
        at org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate
.getDeclaredPointcuts(Java15ReflectionBasedReferenceTypeDelegate.java:307)
        at org.aspectj.weaver.ReferenceType.getDeclaredPointcuts(ReferenceType.j
ava:884)
_______________________________________________
aspectj-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users


_______________________________________________
aspectj-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users
Reply | Threaded
Open this post in threaded view
|

Re: UnsupportedPointcutPrimitiveException

Mohan Radhakrishnan-2
Yes. Spring AOP doesn't work. This works.

public class AspectJConfig {
  @Bean
  public CourseServiceMock CourseServiceAspect() {
 CourseServiceMock aspect = Aspects.aspectOf(CourseServiceMock.class);
      return aspect;
  }
}

Thanks,
Mohan

On 20 September 2016 at 01:40, Andy Clement <[hidden email]> wrote:
I don’t honestly know about Spring AOP and using if() like that. From the documentation:


That lists the supported designators and if() is not on the list I’m afraid.

Could be worth asking on stack overflow about how to achieve what you want in Spring AOP.

cheers,
Andy

On Sep 19, 2016, at 6:42 AM, Mohan Radhakrishnan <[hidden email]> wrote:

Hi,
             This should be supported. Isn't it. I use Spring Tool Suite and @EnableAspectJAutoProxy

Thanks,
Mohan

@Pointcut("execution(* com.pearson.nextgen.enterprise.service.CourseService.getCoursesByInstitutionId(String)) && if()")
    public static boolean courseSearch() {
    return Boolean.getBoolean( mockOrNot.get() ); 
    }


Caused by: org.aspectj.weaver.tools.UnsupportedPointcutPrimitiveException: Point
cut expression 'execution(* com.pearson.nextgen.enterprise.service.CourseService
.getCoursesByInstitutionId(String)) && if()' contains unsupported pointcut primi
tive 'if'
        at org.aspectj.weaver.tools.PointcutParser.validateAgainstSupportedPrimi
tives(PointcutParser.java:435)
        at org.aspectj.weaver.tools.PointcutParser.validateAgainstSupportedPrimi
tives(PointcutParser.java:413)
        at org.aspectj.weaver.tools.PointcutParser.resolvePointcutExpression(Poi
ntcutParser.java:311)
        at org.aspectj.weaver.reflect.InternalUseOnlyPointcutParser.resolvePoint
cutExpression(InternalUseOnlyPointcutParser.java:36)
        at org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate
.getDeclaredPointcuts(Java15ReflectionBasedReferenceTypeDelegate.java:307)
        at org.aspectj.weaver.ReferenceType.getDeclaredPointcuts(ReferenceType.j
ava:884)
_______________________________________________
aspectj-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users


_______________________________________________
aspectj-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users


_______________________________________________
aspectj-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users