|
From: Rob H. <rob...@in...> - 2005-11-01 16:16:39
|
This is fixed in the current CVS HEAD ready for 1.2.6
Marc Logemann wrote:
> 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.createInvocationTraceName(AbstractPerformanceMonitorInterceptor.java:80)
>
> at
> org.springframework.aop.interceptor.JamonPerformanceMonitorInterceptor.invokeUnderTrace(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.JamonPerformanceMonitorInterceptor"/>
>
>
> 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
--
Rob Harrop
Principal Consultant
Interface21 - Spring Services from the Source
http://www.springframework.com
|