title: How to get entire classpath of the modules added to wildfly server
body: <p>I have tried below snippet </p>
  
  <pre><code>String path = System.getProperty("java.class.path");
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>../wildfly-8.2.0.Final/jboss-modules.jar
  
   String modulepath = System.getProperty("jboss.module.path");
  // ../wildfly-8.2.0.Final/jboss-modules.jar
  </code></pre>
  
  <p>and not the ones which i have added in modules</p>
  
  <p>when i try</p>
  
  <pre><code>StringBuffer buffer = new StringBuffer();
  for (URL url :
      ((URLClassLoader) (Thread.currentThread()
      .getContextClassLoader())).getURLs()) {
      buffer.append(new File(url.getPath()));
      buffer.append(System.getProperty("path.separator"));
              }
  </code></pre>
  
  <p>Getting : </p>
  
  <blockquote>
    <p>java.lang.ClassCastException: org.jboss.modules.ModuleClassLoader cannot be cast to java.net.URLClassLoader</p>
  </blockquote>