<div dir="ltr">Hi guys!<div><br></div><div>Through the Instrumentation object that I receive when I register an agent I can obtain all the loaded classes.</div><div><br></div><div>Now each of these loaded classes (Class objects) I use getClasses() and getDeclaredClasses() to get the list of classes that are referred to within the loaded class as well as the Method equivalents to get methods of that loaded class.</div><div>The thing is those methods fail sometimes for reasons I am not sure of. I catch the NoClassDefFoundError in my code, but Jboss still dumps a warn message in console for the same. </div><div>How can I prevent Jboss from dumping this log - since this error was already caught by my code - or is there a way of avoiding this somehow.</div><div><br></div><div>As an example,</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>On the class object for <span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0);font-family:Menlo;font-size:11px">org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator </span>when I call getClasses(), it fails with the below stack  - which I do catch for NoClassDefFoundError.</div><div><br></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">java.lang.NoClassDefFoundError: Failed to link org/springframework/aop/aspectj/autoproxy/AspectJAwareAdvisorAutoProxyCreator$PartiallyComparableAdvisorHolder (Module &quot;deployment.spring-greeter.war&quot; from Service Module Loader): org/aspectj/util/PartialOrder$PartialComparable</span></p></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>at java.lang.ClassLoader.defineClass1(Native Method)</span></p></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>at java.lang.ClassLoader.defineClass(ClassLoader.java:763)</span></p></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>at java.lang.ClassLoader.defineClass(ClassLoader.java:839)</span></p></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:424)</span></p></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:519)</span></p></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:339)</span></p></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:126)</span></p></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>at org.jboss.modules.Module.loadModuleClass(Module.java:731)</span></p></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:247)</span></p></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)</span></p></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)</span></p></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)</span></p></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>at java.lang.Class.getDeclaredClasses0(Native Method)</span></p></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>at java.lang.Class.getDeclaredClasses(Class.java:1867)</span></p></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>at java.lang.Class$2.run(Class.java:1504)</span></p></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>at java.lang.Class$2.run(Class.java:1499)</span></p></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>at java.security.AccessController.doPrivileged(Native Method)</span></p></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>at java.lang.Class.getClasses(Class.java:1498)</span></p></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><br></div><div>But i see this warn message on the console from jboss </div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="garamond, times new roman, serif">2020-01-24 20:37:32,458 WARN  [org.jboss.modules.define] (Agent-Thread) Failed to define class org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator$PartiallyComparableAdvisorHolder in Module &quot;deployment.spring-greeter.war&quot; from Service Module Loader: java.lang.NoClassDefFoundError: Failed to link org/springframework/aop/aspectj/autoproxy/AspectJAwareAdvisorAutoProxyCreator$PartiallyComparableAdvisorHolder (Module &quot;deployment.spring-greeter.war&quot; from Service Module Loader): org/aspectj/util/PartialOrder$PartialComparable</font></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="garamond, times new roman, serif">        at java.lang.ClassLoader.defineClass1(Native Method)</font></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="garamond, times new roman, serif">        at java.lang.ClassLoader.defineClass(ClassLoader.java:763)</font></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="garamond, times new roman, serif">        at java.lang.ClassLoader.defineClass(ClassLoader.java:839)</font></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="garamond, times new roman, serif">        at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:424)</font></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="garamond, times new roman, serif">        at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:519)</font></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="garamond, times new roman, serif">        at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:339)</font></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="garamond, times new roman, serif">        at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:126)</font></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="garamond, times new roman, serif">        at org.jboss.modules.Module.loadModuleClass(Module.java:731)</font></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="garamond, times new roman, serif">        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:247)</font></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="garamond, times new roman, serif">        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)</font></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="garamond, times new roman, serif">        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)</font></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="garamond, times new roman, serif">        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)</font></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="garamond, times new roman, serif">        at java.lang.Class.getDeclaredClasses0(Native Method)</font></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="garamond, times new roman, serif">        at java.lang.Class.getDeclaredClasses(Class.java:1867)</font></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="garamond, times new roman, serif">        at java.lang.Class$2.run(Class.java:1504)</font></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="garamond, times new roman, serif">        at java.lang.Class$2.run(Class.java:1499)</font></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="garamond, times new roman, serif">        at java.security.AccessController.doPrivileged(Native Method)</font></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="garamond, times new roman, serif">        at java.lang.Class.getClasses(Class.java:1498)</font></div></blockquote></blockquote></blockquote>





<div><br></div><div><br></div><div><div><div><div dir="ltr" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><br></div><div dir="ltr">Thanks</div></div><div>./Sam</div></div></div></div></div></div></div></div></div></div></div></div></div>