Community
Participate
Working Groups
Build Identifier: 20100218-1602 For aspectJ 1.6.7 the setup works, however exactly the same setup but changing the aspectJ version to 1.6.8 or 1.6.9 derive to the same error: a piece of code excluded from the aop.xml is woven causing a Verify Error. We are using Proxool, proxy setup which in fact uses CGLIB to create a EnhancerProxy class. In order to avoid VerifyError exceptions the Proxool classes are excluded from aop.xml exactly in the same way the CGLIB workarround is commented in the aspectJ FAQ: <exclude within="*..*Proxool*"/> This is the error we got when we upgrade our 1.6.7 aspejctweaver.jar to 1.6.8. The same is got when using 1.6.9: jvm 3 | 2010/08/03 16:42:53 | java.lang.VerifyError: (class: oracle/jdbc/internal/OracleConnection$$EnhancerByProxool$$7f6320a8, method: getTdoCState signature: (Ljava/lang/String;Ljava/lang/String;)J) Inconsistent stack height 1 != 0 jvm 3 | 2010/08/03 16:42:53 | at java.lang.Class.getDeclaredMethods0(Native Method) jvm 3 | 2010/08/03 16:42:53 | at java.lang.Class.privateGetDeclaredMethods(Class.java:2427) jvm 3 | 2010/08/03 16:42:53 | at java.lang.Class.getDeclaredMethod(Class.java:1935) jvm 3 | 2010/08/03 16:42:53 | at org.logicalcobwebs.cglib.proxy.Enhancer.getCallbacksSetter(Enhancer.java:627) jvm 3 | 2010/08/03 16:42:53 | at org.logicalcobwebs.cglib.proxy.Enhancer.setCallbacksHelper(Enhancer.java:615) jvm 3 | 2010/08/03 16:42:53 | at org.logicalcobwebs.cglib.proxy.Enhancer.setThreadCallbacks(Enhancer.java:609) jvm 3 | 2010/08/03 16:42:53 | at org.logicalcobwebs.cglib.proxy.Enhancer.createUsingReflection(Enhancer.java:631) jvm 3 | 2010/08/03 16:42:53 | at org.logicalcobwebs.cglib.proxy.Enhancer.firstInstance(Enhancer.java:538) jvm 3 | 2010/08/03 16:42:53 | at org.logicalcobwebs.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:225) jvm 3 | 2010/08/03 16:42:53 | at org.logicalcobwebs.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) jvm 3 | 2010/08/03 16:42:53 | at org.logicalcobwebs.cglib.proxy.Enhancer.create(Enhancer.java:285) .... As far as the Verify Error is got while deploying one of the applications that run on the serve we are no able to use the new versions of aspectJ because the application is not properly started up. Thank you very much in advance, Best regards. Reproducible: Always Steps to Reproduce: 1.Exclude Proxool classes from aop.xml using aspectj 1.6.7. It works 2.Upgrade to 1.6.8: it does not work. 3.Upgrade to 1.6.9: it does not work.
Created attachment 175805 [details] This is the unique aop.xml we are using
Created attachment 176202 [details] Proposed Patch
I believe the issue is related to new modifications regarding fast exclusion patterns. While before patterns such us "*..*CGLIB*" where matching for classes like com/mycompany/framework/service/MessageService$$EnhancerByCGLIB$$6dd4e683 Now the *..*CGLIB* patterns are stored in the list excludeStarDotDotStar and the next piece of code is executed: if (!excludeStarDotDotStar.isEmpty()) { for (String namePiece : excludeStarDotDotStar) { int index = fastClassName.lastIndexOf('.'); if (fastClassName.indexOf(namePiece, index + 1) != -1) { return false; } } } where fastClassName = com.mycompany.framework.service.MessageService..EnhancerByCGLIB..6dd4e683 as init previously in the line: String fastClassName = className.replace('/', '.').replace('$', '.'); Which in turns makes the excludeStarDotDotStar method not to work as expected for this kind of patterns because GCGLIB is searched at string 6dd4e683, where never is, so it always return true. In order to avoid this, I suggest just changing the fastClassName at the very beginning avoiding '$' substituion and just after the excludeStarDotDotStar fast pattern check is performed, substitute the '$' character by '.' to allow the rest of code work smoothly. I have created a diff patch with this suggestion already coded. Feedback is welcome. Thank you.
a shame the patch is not against my repo, it does make it messier to apply. I also like to have a test with each patch to stop any future regressions. I've created a tiny test and applied the change. thanks!!