Announcement Announcement Module
Collapse
No announcement yet.
Intercepting "non-wired" code... Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Intercepting "non-wired" code...

    Hello.

    I have a large application - most of the classes are not wired in any applicationContext file to use Spring. I am trying to find all occurrences of Exceptions being caught and swallowed.

    I created my ThrowsAdvice bean and wired everything up in my applicationContext and it works GREAT!! (see my configuration below)

    Question - this only catches exceptions from beans wired in this appContext. Is there a way to cover ALL code running in the JVM?? (the classes not using Spring IoC)?

    Thanks in advance!!!

    Code:
    <!-- Define the ThrowsAdvice bean -->
        <bean id="logThrowsAdvice" class="com.oracle.capplan.RemoteThrowsAdvice"/>
    
        <!-- Wire the advice to the application code -->
        <bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">       
            <property name="beanNames">
                <value>*</value> 
            </property>
            <property name="interceptorNames">
                <list>
                    <value>logThrowsAdvice</value>
                </list>
            </property>
        </bean>

  • #2
    I should also mention that I am using version 1.2.8

    Comment


    • #3
      Originally posted by tgrahn View Post
      ...

      Question - this only catches exceptions from beans wired in this appContext. Is there a way to cover ALL code running in the JVM?? (the classes not using Spring IoC)?

      Thanks in advance!!!
      You are not able to weave the classes loaded by bootstrap classloader but it's possible to apply the aspect to all application classes. Check the following AspectJ reference section - Chapter 5. Load-Time Weaving

      Comment

      Working...
      X