Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Aspectj LTW issue

I am trying to get aspectj ltw working in my app.

My app is structured like below

Test
-- TestCommon
-- TestPersistence
-- TestWeb

where Test is the base EAR project.

I have created a simple logging aspect and placed it in TestCommon. The aop.xml has been placed in TestCommon/Meta-Inf folder.

The problem is with the class loading policy of the app. By default the war class loader policy is set to module. In this case the LTW doesnt seem to work i.e the app doesnt seem to recognize the aspect and ltw doesnt work.

But if I change the war class loader policy to Application, then everything works fine.

What I understand is with module setting , there are 2 class loaders, one for the application and one for the war. In this case the war classes are not recognized. If I move the aop.xml to the web folder , then my other classes in the other projects like TestCommon and TestPersistence are not weaved.

Is there a solution to this issue without changing the war classloader mode to application?
 
Please note that from the debug logs it looks like both the class-loaders recognize the aspect and the aop.xml but only the web class loader does the weaving while the app class loader does nothing .

Back to the top