Results 1 to 7 of 7

Thread: IllegalArgumentException in CustomizableTraceInterceptor

  1. #1
    Join Date
    Aug 2004
    Location
    Germany
    Posts
    24

    Default IllegalArgumentException in CustomizableTraceInterceptor

    Just want to point out a problem with the org.springframework.aop.interceptor.CustomizableTr aceInterceptor

    We used it the following way:
    Code:
    <bean id="loggingInterceptor"
     class="org.springframework.aop.interceptor.CustomizableTraceInterceptor">
    	<property name="enterMessage">
        	<value>$&#91;targetClassShortName&#93;.$&#91;methodName&#93;&#40;$&#91;arguments&#93;&#41; Types&#40;$&#91;argumentTypes&#93;&#41;</value>
    	</property>
    </bean>
    To log the values, passed into our business facade.
    The problem comes in with the the $[arguments] Placeholder. Passing a String containing a dollar sign $ throws a nice
    Code:
    java.lang.IllegalArgumentException&#58; Illegal group reference
    at java.util.regex.Matcher.appendReplacement&#40;Matcher.java&#58;554&#41;
    	at org.springframework.aop.interceptor.CustomizableTraceInterceptor.replacePlaceholders&#40;CustomizableTraceInterceptor.java&#58;321&#41;
    	at org.springframework.aop.interceptor.CustomizableTraceInterceptor.invokeUnderTrace&#40;CustomizableTraceInterceptor.java&#58;274&#41;
    	at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke&#40;AbstractTraceInterceptor.java&#58;77&#41;
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed&#40;ReflectiveMethodInvocation.java&#58;144&#41;
    So we throwed the arguments out of the logging.
    Does anyone know about another solution? Are we doing something wrong here?
    Besides this error this aop style of logging simply rocks. So easy and yet so powerful. Besides this little flaw.

  2. #2
    Join Date
    Aug 2004
    Location
    Southampton, UK
    Posts
    826

    Default

    Karsten,

    Can you raise a JIRA issue for this and ask for it to be assigned to me. I'll put the fix in for 1.2.3.

    Rob
    Rob Harrop
    Lead Engineer, dm Server
    SpringSource
    http://www.springsource.com

    Co-Author - Pro Spring

  3. #3
    Join Date
    Aug 2004
    Location
    Southampton, UK
    Posts
    826

    Default

    Created a JIRA issue at SPR-1151. Issue is marked as resolved and the fix has been added to CVS.

    Rob
    Rob Harrop
    Lead Engineer, dm Server
    SpringSource
    http://www.springsource.com

    Co-Author - Pro Spring

  4. #4
    Join Date
    Aug 2004
    Location
    Germany
    Posts
    24

    Default thanx

    Rob,
    thx a lot for this quick fix. Sorry for not putting it in Jira so fast.
    I am amazed by the speed of your response. Thank you.
    Cheers,
    Karsten.

  5. #5
    Join Date
    Aug 2004
    Location
    Germany
    Posts
    24

    Default

    Just downloaded the brand new 1.2.3 version. So I can confirm fix in Spring 1.2.3.
    Thx again.

  6. #6
    Join Date
    Jan 2006
    Posts
    10

    Default question for CustomizableTraceInterceptor

    I tried to follow the above example. And I tried to get exception error, I could not see degug or log message anywhere. How Can I make to get these message?

    I put the following def in ApplicationContext.xml

    <bean id="traceInterceptor" class="org.springframework.aop.interceptor.Customi zableTraceInterceptor">
    <property name="enterMessage">
    <value>$[targetClassShortName].$[methodName]($[arguments]) Types($[argumentTypes])</value>
    </property>
    <property name="exitMessage"><value>EXIT - {1}{2}</value></property>
    <property name="exceptionMessage"><value>EXIT - {1}{2}</value></property>
    </bean>

    <bean id="wbxml-builder" class="org.springframework.aop.framework.ProxyFact oryBean">
    <property name="proxyInterfaces"><value>xxx.r.builder.Builde r</value></property>
    <property name="interceptorNames">
    <list>
    <value>traceInterceptor</value>

    Please help me to get this log?

    Thanks,

    Kai

  7. #7
    scof Guest

    Default

    Same problem with $[exception] placeholder remains in CustomizableTraceInterceptor. Strangely no one has been reported about it as sign '$' is quite frequently found in stack traces(e.g. in inner classes' names)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •