CDI Weld and AspectJ - org.jboss.weld.exceptions.U

2019-08-16 18:29发布

问题:

I get this error when using AspectJ and CDI.

org.jboss.weld.exceptions.UnproxyableResolutionException: WELD-001437 Normal scoped bean class myPackageName.myClassName is not proxyable because the type is final or it contains a final method static final java.lang.String myPackageName.myClassName.myMethodName_aroundBody0(myPackageName.myClassName.,org.aspectj.lang.JoinPoint).

If I remove AspectJ it works, but I don't want that. Please Help.

回答1:

I got an answer from AspectJ's mailing list, they proposed adding a compile time flag if the method should be final or not, as a workaround. Thanks.