Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@Loggable in combination with springframework's @Cachable and @Async #247

Open
bernieatenovlab opened this issue Sep 15, 2017 · 3 comments

Comments

@bernieatenovlab
Copy link

bernieatenovlab commented Sep 15, 2017

Love the @loggable annotation!!! A few of our methods are annotated with spring's @cachable or @async tags which seem to collide with the @loggable tag.

Are you aware of this issue? An example of an error is below...

weaveinfo Join point 'method-execution(java.util.List com.mycompany.service.impl.event.MyServiceImpl.getMyProfiles(java.util.Locale))' in Type 'com.mycompany.service.impl.event.MyServiceImpl' (MyServiceImpl.java:371) advised by around advice from 'org.springframework.transaction.aspectj.AnnotationTransactionAspect' (spring-aspects-4.3.10.RELEASE.jar!AbstractTransactionAspect.class:66(from AbstractTransactionAspect.aj))
warning at com\mycompany\service\impl\event\MyServiceImpl.java:430::0 at this shadow method-execution(java.util.List com.mycompany.service.impl.event.MyServiceImpl.getMyProfiles(java.util.Locale, java.lang.Long)) no precedence is specified between advice applying from aspect com.jcabi.aspects.aj.MethodLogger and aspect org.springframework.cache.aspectj.AbstractCacheAspect [Xlint:unorderedAdviceAtShadow]
warning at com\mycompany\service\impl\event\MyServiceImpl.java:430::0 at this shadow method-execution(java.util.List com.mycompany.service.impl.event.MyServiceImpl.getMyProfiles(java.util.Locale, java.lang.Long)) no precedence is specified between advice applying from aspect org.springframework.transaction.aspectj.AbstractTransactionAspect and aspect org.springframework.cache.aspectj.AbstractCacheAspect [Xlint:unorderedAdviceAtShadow]
warning at com\mycompany\service\impl\event\MyServiceImpl.java:430::0 at this shadow method-execution(java.util.List com.mycompany.service.impl.event.MyServiceImpl.getMyProfiles(java.util.Locale, java.lang.Long)) no precedence is specified between advice applying from aspect com.jcabi.aspects.aj.MethodLogger and aspect org.springframework.transaction.aspectj.AbstractTransactionAspect [Xlint:unorderedAdviceAtShadow]
warning at com\mycompany\service\impl\event\MyServiceImpl.java:430::0 can not implement lazyTjp on this joinpoint method-execution(java.util.List com.mycompany.service.impl.event.MyServiceImpl.getMyProfiles(java.util.Locale, java.lang.Long)) because around advice is used [Xlint:canNotImplementLazyTjp]
	see also: C:\Users\bl\.m2\repository\org\springframework\spring-aspects\4.3.10.RELEASE\spring-aspects-4.3.10.RELEASE.jar!org\springframework\cache\aspectj\AbstractCacheAspect.class:64::0
abort trouble in: 
com.mycompany.service.impl.event.MyServiceImpl -- (ArrayIndexOutOfBoundsException) 1
1
java.lang.ArrayIndexOutOfBoundsException: 1
	at org.aspectj.weaver.bcel.BcelShadow.prepareForMungers(BcelShadow.java:380)
	at org.aspectj.weaver.Shadow.implement(Shadow.java:546)
	at org.aspectj.weaver.bcel.BcelClassWeaver.implement(BcelClassWeaver.java:3335)
	at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeaver.java:496)
	at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeaver.java:100)
	at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1689)
	at org.aspectj.weaver.bcel.BcelWeaver.weaveWithoutDump(BcelWeaver.java:1633)
	at org.aspectj.weaver.bcel.BcelWeaver.weaveAndNotify(BcelWeaver.java:1398)
	at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1184)
	at org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter.weaveQueuedEntries(AjPipeliningCompilerAdapter.java:514)
	at org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter.afterCompiling(AjPipeliningCompilerAdapter.java:375)
	at org.aspectj.ajdt.internal.compiler.CompilerAdapter.ajc$afterReturning$org_aspectj_ajdt_internal_compiler_CompilerAdapter$2$f9cc9ca0(CompilerAdapter.aj:78)
	at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:421)
	at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation(AjBuildManager.java:1036)
	at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:272)
	at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:185)
	at org.aspectj.ajdt.ajc.AjdtCommand.doCommand(AjdtCommand.java:112)
	at org.aspectj.ajdt.ajc.AjdtCommand.runCommand(AjdtCommand.java:60)
	at org.aspectj.tools.ajc.Main.run(Main.java:371)
	at com.jcabi.maven.plugin.AjcMojo.executeAJC(AjcMojo.java:285)
	at com.jcabi.maven.plugin.AjcMojo.execute_aroundBody2(AjcMojo.java:264)
	at com.jcabi.maven.plugin.AjcMojo$AjcClosure3.run(AjcMojo.java:1)
	at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
	at com.jcabi.aspects.aj.MethodLogger.wrap(MethodLogger.java:208)
	at com.jcabi.aspects.aj.MethodLogger.ajc$inlineAccessMethod$com_jcabi_aspects_aj_MethodLogger$com_jcabi_aspects_aj_MethodLogger$wrap(MethodLogger.java:1)
	at com.jcabi.aspects.aj.MethodLogger.wrapMethod(MethodLogger.java:164)
	at com.jcabi.maven.plugin.AjcMojo.execute_aroundBody4(AjcMojo.java:245)
	at com.jcabi.maven.plugin.AjcMojo$AjcClosure5.run(AjcMojo.java:1)
	at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
	at com.jcabi.aspects.aj.MethodLogger.wrapClass(MethodLogger.java:134)
	at com.jcabi.maven.plugin.AjcMojo.execute(AjcMojo.java:245)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
@0crat
Copy link

0crat commented Sep 15, 2017

@yegor256 please, pay attention to this issue

@yegor256
Copy link
Member

@bernieatenovlab I've never seen this before. Looks like a bug in AspectJ... Maybe you can report it to them somehow? https://github.com/eclipse/org.aspectj

@shiziwen
Copy link

shiziwen commented May 20, 2022

Hi, I also got this warning message when I use jcabi-aspects.

./gradlew clean build

WARN:
 * warning build config error: skipping missing, empty or corrupt inpath entry: /Users/tron/Documents/codes/test_retry/build/classes/java/test
 * warning at /Users/tron/.gradle/caches/modules-2/files-2.1/com.jcabi/jcabi-aspects/0.22.6/a4c2f03f4934a5c4bbb550e4c82c8d12494cbf00/jcabi-aspects-0.22.6.jar!com/jcabi/aspects/aj/ImmutabilityChecker.class::0 can not build thisJoinPoint lazily for this advice since it has no suitable guard [Xlint:noGuardForLazyTjp]
 * warning at /Users/tron/.gradle/caches/modules-2/files-2.1/com.jcabi/jcabi-aspects/0.22.6/a4c2f03f4934a5c4bbb550e4c82c8d12494cbf00/jcabi-aspects-0.22.6.jar!com/jcabi/aspects/aj/MethodCacher.class::0 can not build thisJoinPoint lazily for this advice since it has no suitable guard [Xlint:noGuardForLazyTjp]
 * warning at /Users/tron/.gradle/caches/modules-2/files-2.1/com.jcabi/jcabi-aspects/0.22.6/a4c2f03f4934a5c4bbb550e4c82c8d12494cbf00/jcabi-aspects-0.22.6.jar!com/jcabi/aspects/aj/MethodCacher.class::0 can not build thisJoinPoint lazily for this advice since it has no suitable guard [Xlint:noGuardForLazyTjp]
 * warning at /Users/tron/.gradle/caches/modules-2/files-2.1/com.jcabi/jcabi-aspects/0.22.6/a4c2f03f4934a5c4bbb550e4c82c8d12494cbf00/jcabi-aspects-0.22.6.jar!com/jcabi/aspects/aj/MethodScheduler.class::0 can not build thisJoinPoint lazily for this advice since it has no suitable guard [Xlint:noGuardForLazyTjp]
 * warning at /Users/tron/.gradle/caches/modules-2/files-2.1/com.jcabi/jcabi-aspects/0.22.6/a4c2f03f4934a5c4bbb550e4c82c8d12494cbf00/jcabi-aspects-0.22.6.jar!com/jcabi/aspects/aj/MethodScheduler.class::0 can not build thisJoinPoint lazily for this advice since it has no suitable guard [Xlint:noGuardForLazyTjp]
 * warning at /Users/tron/.gradle/caches/modules-2/files-2.1/com.jcabi/jcabi-aspects/0.22.6/a4c2f03f4934a5c4bbb550e4c82c8d12494cbf00/jcabi-aspects-0.22.6.jar!com/jcabi/aspects/aj/MethodValidator.class::0 can not build thisJoinPoint lazily for this advice since it has no suitable guard [Xlint:noGuardForLazyTjp]
 * warning at /Users/tron/.gradle/caches/modules-2/files-2.1/com.jcabi/jcabi-aspects/0.22.6/a4c2f03f4934a5c4bbb550e4c82c8d12494cbf00/jcabi-aspects-0.22.6.jar!com/jcabi/aspects/aj/MethodValidator.class::0 can not build thisJoinPoint lazily for this advice since it has no suitable guard [Xlint:noGuardForLazyTjp]
 * warning at /Users/tron/.gradle/caches/modules-2/files-2.1/com.jcabi/jcabi-aspects/0.22.6/a4c2f03f4934a5c4bbb550e4c82c8d12494cbf00/jcabi-aspects-0.22.6.jar!com/jcabi/aspects/aj/MethodValidator.class::0 can not build thisJoinPoint lazily for this advice since it has no suitable guard [Xlint:noGuardForLazyTjp]
 * warning at tron/test/Main.java:18::0 can not implement lazyTjp on this joinpoint method-execution(java.lang.String tron.test.Main.load()) because around advice is used [Xlint:canNotImplementLazyTjp]
        see also: /Users/tron/.gradle/caches/modules-2/files-2.1/com.jcabi/jcabi-aspects/0.22.6/a4c2f03f4934a5c4bbb550e4c82c8d12494cbf00/jcabi-aspects-0.22.6.jar!com/jcabi/aspects/aj/Repeater.class::0
 * warning at /Users/tron/.gradle/caches/modules-2/files-2.1/com.jcabi/jcabi-aspects/0.22.6/a4c2f03f4934a5c4bbb550e4c82c8d12494cbf00/jcabi-aspects-0.22.6.jar!com/jcabi/aspects/aj/MethodLogger.class::0 advice defined in com.jcabi.aspects.aj.MethodLogger has not been applied [Xlint:adviceDidNotMatch]
 * warning at /Users/tron/.gradle/caches/modules-2/files-2.1/com.jcabi/jcabi-aspects/0.22.6/a4c2f03f4934a5c4bbb550e4c82c8d12494cbf00/jcabi-aspects-0.22.6.jar!com/jcabi/aspects/aj/ImmutabilityChecker.class::0 advice defined in com.jcabi.aspects.aj.ImmutabilityChecker has not been applied [Xlint:adviceDidNotMatch]
 * warning at /Users/tron/.gradle/caches/modules-2/files-2.1/com.jcabi/jcabi-aspects/0.22.6/a4c2f03f4934a5c4bbb550e4c82c8d12494cbf00/jcabi-aspects-0.22.6.jar!com/jcabi/aspects/aj/MethodScheduler.class::0 advice defined in com.jcabi.aspects.aj.MethodScheduler has not been applied [Xlint:adviceDidNotMatch]
 * warning at /Users/tron/.gradle/caches/modules-2/files-2.1/com.jcabi/jcabi-aspects/0.22.6/a4c2f03f4934a5c4bbb550e4c82c8d12494cbf00/jcabi-aspects-0.22.6.jar!com/jcabi/aspects/aj/ExceptionsLogger.class::0 advice defined in com.jcabi.aspects.aj.ExceptionsLogger has not been applied [Xlint:adviceDidNotMatch]
 * warning at /Users/tron/.gradle/caches/modules-2/files-2.1/com.jcabi/jcabi-aspects/0.22.6/a4c2f03f4934a5c4bbb550e4c82c8d12494cbf00/jcabi-aspects-0.22.6.jar!com/jcabi/aspects/aj/MethodValidator.class::0 advice defined in com.jcabi.aspects.aj.MethodValidator has not been applied [Xlint:adviceDidNotMatch]
 * warning at /Users/tron/.gradle/caches/modules-2/files-2.1/com.jcabi/jcabi-aspects/0.22.6/a4c2f03f4934a5c4bbb550e4c82c8d12494cbf00/jcabi-aspects-0.22.6.jar!com/jcabi/aspects/aj/SingleException.class::0 advice defined in com.jcabi.aspects.aj.SingleException has not been applied [Xlint:adviceDidNotMatch]
 * warning at /Users/tron/.gradle/caches/modules-2/files-2.1/com.jcabi/jcabi-aspects/0.22.6/a4c2f03f4934a5c4bbb550e4c82c8d12494cbf00/jcabi-aspects-0.22.6.jar!com/jcabi/aspects/aj/MethodInterrupter.class::0 advice defined in com.jcabi.aspects.aj.MethodInterrupter has not been applied [Xlint:adviceDidNotMatch]
 * warning at /Users/tron/.gradle/caches/modules-2/files-2.1/com.jcabi/jcabi-aspects/0.22.6/a4c2f03f4934a5c4bbb550e4c82c8d12494cbf00/jcabi-aspects-0.22.6.jar!com/jcabi/aspects/aj/QuietExceptionsLogger.class::0 advice defined in com.jcabi.aspects.aj.QuietExceptionsLogger has not been applied [Xlint:adviceDidNotMatch]
 * warning at /Users/tron/.gradle/caches/modules-2/files-2.1/com.jcabi/jcabi-aspects/0.22.6/a4c2f03f4934a5c4bbb550e4c82c8d12494cbf00/jcabi-aspects-0.22.6.jar!com/jcabi/aspects/aj/Parallelizer.class::0 advice defined in com.jcabi.aspects.aj.Parallelizer has not been applied [Xlint:adviceDidNotMatch]
 * warning at /Users/tron/.gradle/caches/modules-2/files-2.1/com.jcabi/jcabi-aspects/0.22.6/a4c2f03f4934a5c4bbb550e4c82c8d12494cbf00/jcabi-aspects-0.22.6.jar!com/jcabi/aspects/aj/MethodAsyncRunner.class::0 advice defined in com.jcabi.aspects.aj.MethodAsyncRunner has not been applied [Xlint:adviceDidNotMatch]
 * warning at /Users/tron/.gradle/caches/modules-2/files-2.1/com.jcabi/jcabi-aspects/0.22.6/a4c2f03f4934a5c4bbb550e4c82c8d12494cbf00/jcabi-aspects-0.22.6.jar!com/jcabi/aspects/aj/MethodCacher.class::0 advice defined in com.jcabi.aspects.aj.MethodCacher has not been applied [Xlint:adviceDidNotMatch]

And I have put the test on https://github.com/shiziwen/test_retry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants