<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=gdub" rel="nofollow">Greg Wiley</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-3519?redirect=false" rel="nofollow">SPR-3519</a></strong> and commented</p>
<p dir="auto">Using the AspectJ annotation configuration method.</p>
<p dir="auto">If two advice apply to the same join point and the lower-priority advice has (non JP) parameters, those parameters will not be bound.</p>
<p dir="auto">This occurs in Spring 2.0.5 but not in Spring 2.0.2.</p>
<p dir="auto">Only jars on the CP are those in the -with-dependencies Spring distribution.</p>
<p dir="auto">\spring-framework-2.0.5\lib\aspectj\aspectjrt.jar<br>
\spring-framework-2.0.5\lib\aspectj\aspectjweaver.jar<br>
\spring-framework-2.0.5\lib\asm\asm-2.2.3.jar<br>
\spring-framework-2.0.5\dist\spring-aspects.jar<br>
\spring-framework-2.0.5\dist\spring.jar<br>
\spring-framework-2.0.5\lib\jakarta-commons\commons-logging.jar<br>
\spring-framework-2.0.5\lib\asm\asm-commons-2.2.3.jar<br>
\spring-framework-2.0.5\lib\asm\asm-util-2.2.3.jar</p>
<p dir="auto">Demonstration spike attached.</p>
<p dir="auto">Note that in the demonstration, the exception can be eliminated by either:</p>
<ol dir="auto">
<li>removing one of the advice classes from the configuration</li>
<li>re-ordering the advice (so that the non-arg advice is lower priority)</li>
<li>switching to Spring 2.0.2</li>
</ol>
<p dir="auto">This problem has been documented by others in the Spring forums.</p>
<p dir="auto">-dub</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.0.5</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/12628/eg.zip" rel="nofollow">eg.zip</a> (<em>2.04 kB</em>)</li>
</ul>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398077968" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/8155" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/8155/hovercard" href="https://github.com/spring-projects/spring-framework/issues/8155">#8155</a> Bad interactions betwen advice when one binds the original method parameters and one does not. (<em><strong>"duplicates"</strong></em>)</li>
</ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=tomdewire" rel="nofollow">Tom DeWire</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-3472?redirect=false" rel="nofollow">SPR-3472</a></strong> and commented</p>
<p dir="auto">Repeated from my original forum post: (<a href="http://forum.springframework.org/showthread.php?t=38619" rel="nofollow">http://forum.springframework.org/showthread.php?t=38619</a>)</p>
<p dir="auto">We have two pieces of advice that we would like to execute "around" a service method. The service method takes a single parameter.</p>
<p dir="auto">The first piece of advice (AdviceA in this example) wants to capture all of the methods in the class. It does not care about the parameters passed into those methods.</p>
<p dir="auto">The second piece of advice (AdviceB in this example) wants to capture a specific method. It does care about the parameter. It wants to record this transaction into the logs if certain criteria are met.</p>
<p dir="auto">This was all working fine in spring 2.0.2. We recently attempted to upgrade to 2.0.5, and we ran into some failures. We backed off the versions and determined the root cause appears to be a change introduced with 2.0.3.</p>
<p dir="auto">Specifically, we're receive this error immediately after calling proceed() from the first piece of advice:</p>
<p dir="auto">Exception in thread "main" java.lang.IllegalStateException: Required to bind 2 arguments, but only bound 1 (JoinPointMatch was NOT bound in invocation)</p>
<p dir="auto">It seems worth noting that either of these pieces of advice will execute just fine if they are allowed to execute alone. It is only when <strong>both</strong> pieces of advice are applied that we run into this issue.</p>
<p dir="auto">I've managed to replicate this behavior in a very small test. I'll attempt to attach that to this bug (if i'm allowed to do that sort of thing).</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.0.3, 2.0.4, 2.0.5</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/12591/aop-test.zip" rel="nofollow">aop-test.zip</a> (<em>12.96 kB</em>)</li>
<li><a href="https://jira.spring.io/secure/attachment/12595/aop-test-dependencies-corrected.zip" rel="nofollow">aop-test-dependencies-corrected.zip</a> (<em>13.13 kB</em>)</li>
</ul>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398078267" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/8202" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/8202/hovercard" href="https://github.com/spring-projects/spring-framework/issues/8202">#8202</a> around advice does not bind parameters if another advise is active on same join point (<em><strong>"is duplicated by"</strong></em>)</li>
</ul>