Announcement Announcement Module
Collapse
No announcement yet.
Activating Spring AspectJ support in Tomcat Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Activating Spring AspectJ support in Tomcat

    Hello,

    I'm not sure if my question belongs to this forum, or to Web forum, but anyway...

    In an application, deployed to Tomcat 5.5, I have some classes annotated with @Configurable and <aop:spring-configured/> tag in the context.

    There is no problem to activate load-time weaving in a Tomcat globally,
    by suppliying -javaagent:aspectjweaver.jar to JVM that Tomcat is running on.

    But is it possible to do it more specifically, to my Web-application only?
    BTW, by using TomcatInstrumentableClassLoader (from org.springframework.instrument.classloading.tomcat ). I have not found a way to configure it properly

  • #2
    Would using &lt;include&gt; suffice?

    You may use <include> section of your aop.xml to specify type pattern matching only your web-application. For example, you could do something like
    Code:
    <weaver>
        <include within="com.myco.myapp..*"/>
    </weaver>
    This should give you the desired effect.

    -Ramnivas

    Comment


    • #3
      Originally posted by ramnivas
      You may use <include> section of your aop.xml to specify type pattern matching only your web-application. For example, you could do something like
      Code:
      <weaver>
          <include within="com.myco.myapp..*"/>
      </weaver>
      This should give you the desired effect.

      -Ramnivas
      Sorry, but not exactly so.
      With this setting (which BTW was already in place when I have posted my question ) AspectJ anyway take a look on each loaded class (as you can see from log) just to say that it want to skip it. And my aop.xml affect only my application, so nobody can warranty how AspectJ will treat another application on the same Tomcat (as I have no idea about their configurations). My goal is to restrict usage of instrumented classloader to my application only.

      Comment

      Working...
      X