<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=SL link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span lang=EN-US>You could try running server with -Dorg.wildfly.logging.skipLogManagerCheck=true parameter which should skip log manager check.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>But it could also result in issues with logging.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>--<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>tomaz<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal style='border:none;padding:0cm'><b>From: </b><a href="mailto:ebenzacar@gmail.com">Eric B</a><br><b>Sent: </b>sreda, 18. oktober 2017 14:40<br><b>To: </b><a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a><br><b>Subject: </b>[wildfly-dev] Dynamically attaching AspectJ LTW weaver from EAR</p></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Hi,</p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I'm looking to use AspectJ Load Time Weaving with Wildfly 10. Looking around at some posts, it is a little complicated to get Wildfly launched properly with the AJ weaver due to the way the AJ library intializes the logging subsystem differently than WF.</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Digging around, I found a config that actually works. It is documented here (obviously some of the class names/versions have to change): <a href="https://github.com/ChienChingLee/How-to-launch-Wildfly-9.0-with-AspectJ-1.8-LTW">https://github.com/ChienChingLee/How-to-launch-Wildfly-9.0-with-AspectJ-1.8-LTW</a></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>But I'm not a fan of changing my conf file to something that has hardcoded paths/jar names in it - for example adding:</p></div><div><p class=MsoNormal><span style='background:white'> </span><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>-Xbootclasspath/p:$JBOSS_HOME/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-2.0.0.Final.jar </span></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>Digging around some more in AJ, I saw that as of AJ 1.8.7, there is a way to dynamically attach the weaver to the JVM. Very cool. <a href="https://www.eclipse.org/aspectj/doc/released/README-187.html">https://www.eclipse.org/aspectj/doc/released/README-187.html</a> </p><div><p class=MsoNormal>But in order to use the LTW effectively, I need to ensure that the weaver is loaded prior to WF scanning and loading any of my classes (EJB, annotated beans, pojos, etc). But I have no ideas how to do that.</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>In the case of a console application, it is pretty straight forward - make it the first item in the application's main() method. But in the case of a JEE app, I don't know of any main() equivalent.</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Is there a way to hook into the classloading mechanism of WF instead to tell it to load the weaver if it isn't already loaded? Can this be done from within the EAR deployment? Or is there a single point of entry that WF accesses before scanning any of the classes in the EAR? Or is there a simpler way of configuring or attaching the AJ Weaver? I did find an old ticket (<a href="https://issues.jboss.org/browse/WFLY-895">https://issues.jboss.org/browse/WFLY-895</a>) that related to this issue, but it is marked as WONT FIX.</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Am not sure of the best approach at this point.</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Thanks,</p></div><div><p class=MsoNormal><o:p> </o:p></p></div></div><p class=MsoNormal>Eric</p><p class=MsoNormal><o:p> </o:p></p></div></body></html>