1 Reply Latest reply on Aug 21, 2017 9:39 AM by claudio4j

    Share properties file among slaves in domain mode Wildfly10




      In domain mode , I am able to use properties file as a module but the problem is if there is any modification in the file then i'l need to do it for all slaves in the domain. I want to centralize the file so that at one point I can change and it will be reflected on all slaves.

      I know in domain.xml we can configure global level system properties but I have around 25 properties files.

      So is there a way to centralized the files??

          --> class
          -->xml files

      myjar.jar is an archived jar file To fetch the xml files

      URL url = Thread.currentThread().getContextClassLoader().getResource("./properties"); 
      File queryFolder = new File(url.getFile()); 
      for (File fileName : queryFolder.listFiles())  // null pointer exception
      if (fileName.getName().toUpperCase().endsWith("XML"))
      { saxParser.parse(fileName, this);
      } }

      This is not working.

      Tried this

      How do I list the files inside a JAR file?

      And facing the same problem given in below link

      JBoss wildfly 8.x Provider "vfs" not installed when using java nio Paths

      URL w_url = mmyClass.class.getProtectionDomain().getCodeSource().getLocation(); JarEntry w_ze = null;
      .info("Jar******************" + w_url.toString());
      if (w_url.toString().endsWith(".jar"))
         try (JarInputStream jar = new JarInputStream(w_url.openStream()))
             while ((w_ze = jar.getNextJarEntry()) != null)
      .info("Name *******" + w_ze.getName());
      catch(Exception e) {  }