|
From: Juergen H. <ju...@in...> - 2005-11-08 13:33:26
|
Thanks for pointing this out, Marc. This has already been fixed right after 1.2.5, always having prefix/suffix to be at least empty String (http://opensource2.atlassian.com/projects/spring/browse/SPR-1355). The nightly 1.2.6 snapshots already contain this fix for a while. Feel free to give it a try and let me know whether it works for you! Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...] On Behalf Of Marc Logemann Sent: Monday, October 31, 2005 8:22 PM To: spr...@li... Subject: [Springframework-developer] AbstractPerformanceMonitorInterceptor changed for bad in 1.2.5 Hi, please take a look at that stack: java.lang.NullPointerException at java.lang.StringBuffer.<init>(StringBuffer.java:80) at org.springframework.aop.interceptor.AbstractPerformanceMonitorInterceptor.cr eateInvocationTraceName(AbstractPerformanceMonitorInterceptor.java:80) at org.springframework.aop.interceptor.JamonPerformanceMonitorInterceptor.invok eUnderTrace(JamonPerformanceMonitorInterceptor.java:57) [..] this is the related Spring config: <!-- =================================== --> <!-- AutpoProxy Creator --> <!-- =================================== --> <bean id="proxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator" > <property name="beanNames"> <list> <value>loginService</value> </list> </property> <property name="interceptorNames"> <list> <value>JAMonInterceptor</value> </list> </property> </bean> <bean id="JAMonInterceptor" class="org.springframework.aop.interceptor.JamonPerformanceMonitorIntercepto r"/> This configuration worked for months but after upgrading to Spring 1.2.5 i am getting the stack. The reason is quite obvious, Juergen tried to be a good boy and used StringBuffer instead of String concatenation and initialized it with a Prefix, but i dont have a prefix and i dont know if its a good idea to take for granted that there is one. See the relevant method from Spring _before_ 1.2.5 --- snipp --- protected String createInvocationTraceName(MethodInvocation invocation){ String invocationData = invocation.getMethod().getDeclaringClass().getName() + "." + invocation.getMethod().getName(); return getPrefix() + invocationData + getSuffix(); } --- snapp --- Now the current one in 1.2.5: --- snipp --- protected String createInvocationTraceName(MethodInvocation invocation){ StringBuffer sb = new StringBuffer(getPrefix()); sb.append(invocation.getMethod().getDeclaringClass().getName()); sb.append('.').append(invocation.getMethod().getName()); sb.append(getSuffix()); return sb.toString(); } --- snapp --- So either we should intitialize the prefix property with "" or just dont use the parametrized constructor of StringBuffer. Tell me what you think.... Marc Logemann http://www.logemann.org ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |