0 Replies Latest reply on Aug 28, 2015 6:42 AM by sridhar thiyagarajan

    AspectJ load time weaving not working properly with Wildfly AS 8.2.0-Final in Unix / Linux environment.

    sridhar thiyagarajan Novice

      Hello,

       

      I am using Load Time Weaving of AspectJ API 1.8.6 version in an EAR application. JDK version used is "1.8_51" and wildfly application server version is "8.2.0-Final". I have created a custom module "test.aop" containing META-INF/aop.xml under "$wildfly_home/modules" directory. I have all my aspects in a separate JAR and am maintaining aop.xml in a separate module to have it as configurable. I am referring the module "test.aop" in the EAR classpath by adding it in dependencies.

       

      test.aop module folder structure:

       

      $wildfly_home

          modules

                 test

                     aop

                        main

                              module.xml

                              META-INF

                                   aop.xml

       

      Using the VM argument -Dorg.aspectj.weaver.loadtime.configuration=META-INF/aop.xml in VM arguments section of application server of eclipse luna made AspectJ AOP and load time weaving to work fine. I also tested the same by adding necessary VM arguments in standalone.bat and standalone.conf.bat and AOP is working fine.

       

      But, when the same setup is done in Unix / Linux, it is not working.

       

      So, I tried the VM argument -Dorg.aspectj.weaver.loadtime.configuration=file:$JBOSS_HOME/modules/test/aop/main/META-INF/aop.xml and what I observed is I was getting error as mentioned below till the EAR application got deployed and after deployment, I was not getting the error and AOP was working fine.

       

      Error obtained:

       

      2015-08-27 17:25:59,419 ERROR [stderr] (main) [ModuleClassLoader@2c34f934] error Cannot find parent aspect for: <concrete-aspect name='com.test.it.server.aop.aspect.DAOOpenAspectImpl' extends='com.test.it.server.aop.aspect.DAOOpenAspect' perclause='percflow(readSasDaoPC() || writeSasDaoPC())'/> in aop.xml

      2015-08-27 17:25:59,420 ERROR [stderr] (main) [ModuleClassLoader@2c34f934] error Concrete-aspect 'com.test.it.server.aop.aspect.DAOOpenAspectImpl' could not be registered

      2015-08-27 17:25:59,420 ERROR [stderr] (main) [ModuleClassLoader@2c34f934] warning failure(s) registering aspects. Disabling weaver for class loader org.jboss.modules.ModuleClassLoader@2c34f934

      2015-08-27 17:25:59,437 ERROR [stderr] (main) [ModuleClassLoader@3b2cf7ab] error Cannot find parent aspect for: <concrete-aspect name='com.test.it.server.aop.aspect.DAOOpenAspectImpl' extends='com.test.it.server.aop.aspect.DAOOpenAspect' perclause='percflow(readSasDaoPC() || writeSasDaoPC())'/> in aop.xml

      2015-08-27 17:25:59,444 ERROR [stderr] (main) [ModuleClassLoader@3b2cf7ab] error Concrete-aspect 'com.test.it.server.aop.aspect.DAOOpenAspectImpl' could not be registered

      2015-08-27 17:25:59,444 ERROR [stderr] (main) [ModuleClassLoader@3b2cf7ab] warning failure(s) registering aspects. Disabling weaver for class loader org.jboss.modules.ModuleClassLoader@3b2cf7ab

      2015-08-27 17:25:59,478 ERROR [stderr] (main) [ModuleClassLoader@75329a49] error Cannot find parent aspect for: <concrete-aspect name='com.test.it.server.aop.aspect.DAOOpenAspectImpl' extends='com.test.it.server.aop.aspect.DAOOpenAspect' perclause='percflow(readSasDaoPC() || writeSasDaoPC())'/> in aop.xml

      2015-08-27 17:25:59,479 ERROR [stderr] (main) [ModuleClassLoader@75329a49] error Concrete-aspect 'com.test.it.server.aop.aspect.DAOOpenAspectImpl' could not be registered

      2015-08-27 17:25:59,479 ERROR [stderr] (main) [ModuleClassLoader@75329a49] warning failure(s) registering aspects. Disabling weaver for class loader org.jboss.modules.ModuleClassLoader@75329a49

      2015-08-27 17:25:59,496 ERROR [stderr] (main) [ModuleClassLoader@20d28811] error Cannot find parent aspect for: <concrete-aspect name='com.test.it.server.aop.aspect.DAOOpenAspectImpl' extends='com.test.it.server.aop.aspect.DAOOpenAspect' perclause='percflow(readSasDaoPC() || writeSasDaoPC())'/> in aop.xml

      2015-08-27 17:25:59,497 ERROR [stderr] (main) [ModuleClassLoader@20d28811] error Concrete-aspect 'com.test.it.server.aop.aspect.DAOOpenAspectImpl' could not be registered

      2015-08-27 17:25:59,497 ERROR [stderr] (main) [ModuleClassLoader@20d28811] warning failure(s) registering aspects. Disabling weaver for class loader org.jboss.modules.ModuleClassLoader@20d28811

      2015-08-27 17:25:59,510 ERROR [stderr] (main) [ModuleClassLoader@9225652] error Cannot find parent aspect for: <concrete-aspect name='com.test.it.server.aop.aspect.DAOOpenAspectImpl' extends='com.test.it.server.aop.aspect.DAOOpenAspect' perclause='percflow(readSasDaoPC() || writeSasDaoPC())'/> in aop.xml

      2015-08-27 17:25:59,511 ERROR [stderr] (main) [ModuleClassLoader@9225652] error Concrete-aspect 'com.test.it.server.aop.aspect.DAOOpenAspectImpl' could not be registered

      2015-08-27 17:25:59,511 ERROR [stderr] (main) [ModuleClassLoader@9225652] warning failure(s) registering aspects. Disabling weaver for class loader org.jboss.modules.ModuleClassLoader@9225652

      2015-08-27 17:25:59,530 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.2.Final

      2015-08-27 17:25:59,594 ERROR [stderr] (main) [MethodUtil@63070bab] error Cannot find parent aspect for: <concrete-aspect name='com.test.it.server.aop.aspect.DAOOpenAspectImpl' extends='com.test.it.server.aop.aspect.DAOOpenAspect' perclause='percflow(readSasDaoPC() || writeSasDaoPC())'/> in aop.xml

      2015-08-27 17:25:59,594 ERROR [stderr] (main) [MethodUtil@63070bab] error Concrete-aspect 'com.test.it.server.aop.aspect.DAOOpenAspectImpl' could not be registered

      2015-08-27 17:25:59,595 ERROR [stderr] (main) [MethodUtil@63070bab] warning failure(s) registering aspects. Disabling weaver for class loader sun.reflect.misc.MethodUtil@63070bab

      2015-08-27 17:25:59,602 ERROR [stderr] (main) [ModuleClassLoader@d21a74c] error Cannot find parent aspect for: <concrete-aspect name='com.test.it.server.aop.aspect.DAOOpenAspectImpl' extends='com.test.it.server.aop.aspect.DAOOpenAspect' perclause='percflow(readSasDaoPC() || writeSasDaoPC())'/> in aop.xml

      2015-08-27 17:25:59,602 ERROR [stderr] (main) [ModuleClassLoader@d21a74c] error Concrete-aspect 'com.test.it.server.aop.aspect.DAOOpenAspectImpl' could not be registered

      2015-08-27 17:25:59,603 ERROR [stderr] (main) [ModuleClassLoader@d21a74c] warning failure(s) registering aspects. Disabling weaver for class loader org.jboss.modules.ModuleClassLoader@d21a74c

       

       

      JFYI that I am packaging all my aspects in a jar that is under EAR and I cannot deploy it as a separate module as it depends on other jars.


       

      Could anyone please help why I am not getting this error in Windows 7 and getting it in Unix / Linux. Is class loading different in Windows 7 and unix / linux regarding Wildfly ? Can anyone please help to fix this problem as it clearly says it cannot find the class in Unix / Linux but am not getting the same in Windows 7.