|
[
Permlink
| « Hide
]
Mark St.Godard added a comment - 21/Jul/08 11:49 AM
Attached full stack trace
Note: The reason CBLib is failing to create the proxy is due to the fact that the SimpleJobRepository does not have a public default constructor
although the comment in the code seems to have that intention... /** * Provide default constructor with low visibility in case user wants to use * use aop:proxy-target-class="true" for transaction interceptor. */ SimpleJobRepository() { } More information on the original forum posts: http://forum.springframework.org/showthread.php?p=189081 Hi Dave,
Re: "It should work with 2.5.x. Not sure where (in 2.0.x?) this would have been fixed in Spring Core." I am using Spring 2.5.5... You think the auto proxying and mix and matching proxy-target-class works in the latest.. ? I will check the source, do you know if its something you need to enable? (i.e. not the default behavior) That would be good, because that would solve 2 of my problems... :) However, I believe the problem would still remain if you wanted to use CGLib..... Is there a reason why the constructor is "default" visibility? Cheers Mark The constructor is default visibility because it doesn't make sense as part of the public API (as signalled by the real constructor with all the mandatory properties). I tried a quick experiment with proxy-target-class="true" and a simple non-batch test case and that worked with 2.5.5, so I'm not sure why your experience should be any different. I didn't do anything fancy (using cglib:cglib-nodep:2.1_3).
Hi Dave,
Very weird, yeah I have the same Spring and CGlib version.... I also dumbed down my example and I still get one aop:config overriding the others. I apologize in advance, for veering off into the Spring Core.... But I do see these issues related to your comment that this is fixed http://jira.springframework.org/browse/SPR-2593 http://jira.springframework.org/browse/SPR-1980 I looks like Juergen said he checked some stuff in ... however I didnt see anything obvious in FishEye... I know when I debug my example... it gets into AopNamespaceUtils... twice.. and one of the invocations, then calls AopConfigUtils.forceAutoProxyCreatorToUseClassProxying(registry); private static void useClassProxyingIfNecessary(BeanDefinitionRegistry registry, Element sourceElement) { if (sourceElement != null) { boolean proxyTargetClass = Boolean.valueOf( sourceElement.getAttribute(PROXY_TARGET_CLASS_ATTRIBUTE)).booleanValue(); if (proxyTargetClass) { AopConfigUtils.forceAutoProxyCreatorToUseClassProxying(registry); } } } Did you have your non-batch test case? I would be curious to run it as well... in my example, I did a simple case with 2 applicationContext files, 1 bean in each, and 2 aop-config snippets... one with proxy-target-class set to true.... I am probably missing something Cheers |
|||||||||||||||||||||||||||||||||||||||||||||||