4 Replies Latest reply on Feb 6, 2019 12:05 AM by jaikiran pai

    Wildfly 14, Java.nio.file.AccessDeniedException Issue

    Jijo Nemera Newbie

      I create a custom module for Wildfly configuration and I am having hard time starting service. When I was using Wildfly 10 I didn’t have this Issue, this issue occurs on Wildfly 14. The issue is when the module is loaded and initialized I get an exception Java.nio.file.AccessDeniedException message. The reason is in the Resource-root directory there are some files which are restricted to the current user. I tried to add a filter to skip this file from being red, apparently the filters didn’t work, because the exception is being thrown before the filters are even applied. This class is where the module is loaded and initialized.(https://github.com/jboss-modules/jboss-modules/blob/1.x/src/main/java/org/jboss/modules/ModuleClassLoader.java (line 194) in this method it has the resource root and filter definitions from the XML – it applies the path filter in line 200, unfortunately the exception occurs in line 199 which performs a walk around of the folder tree pointed by the resource root.

      I was wondering why this worked on Wildfly 10 and not Wildfly14. And Is there something I can do to bypass this issue with out changing the permission of the directories.

       

      module.xml

       

      <module xmlns="urn:jboss:module:1.1" name="system.module" slot="sample" >

          <resources>

              <resource-root path="../../">

                  <filter>

                      <exclude name="backup"/>

                  </filter>

              </resource-root>

          </resources>

      </module>

        • 1. Re: Wildfly 14, Java.nio.file.AccessDeniedException Issue
          jaikiran pai Master

          Can you please attach the complete exception stacktrace? The fact that you even debugged this to specific code in JBoss Modules is a good thing, but having the stacktrace in this thread will help some of us to better understand what might be going on. Which exact operating system is this and which version and vendor of Java is this? You can paste the output of:

           

          java -version

           

          The reason is in the Resource-root directory there are some files which are restricted to the current user

          What kind of restrictions are applied to the directory?

          • 2. Re: Wildfly 14, Java.nio.file.AccessDeniedException Issue
            Jijo Nemera Newbie

            Hi Jaikiran,

            Thank you for your response.

             

            - There are some files which have 700 permission on them. so they can be accessed by  the Administrator.  If I change the file permission to 777 everything works OK.

             

            Exception stacktrace from the log file

            -------------------------------------------------

            2019-01-22 12:10:47,293 TRACE [org.jboss.modules] (Thread-2 (ActiveMQ-client-global-threads)) Loading class org.apache.activemq.artemis.service.extensions.xa.recovery.ActiveMQXARecoveryLogger_$logger locally from Module "org.apache.activemq.artemis" version 2.6.3.jbossorg-001 from local module loader @26653222 (finder: local module finder @3532ec19 (roots: /opt/Infor/Wildfly14/modules,/opt/Infor/Wildfly14/modules/system/layers/base,/tspenv1/gen,/tspenv1/law))

            2019-01-22 12:10:47,294 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "cluster-services.ear")]) - failure description: {"WFLYCTL0080: Failed services" => {

                "jboss.module.service.\"deployment.cluster-services.ear\".main" => "WFLYSRV0179: Failed to load module: deployment.cluster-services.ear

                Caused by: org.jboss.modules.ModuleNotFoundException: system.module:lsf",

                "jboss.module.service.\"deployment.cluster-services.ear.services-cluster.jar\".main" => "WFLYSRV0179: Failed to load module: deployment.cluster-services.ear.services-cluster.jar

                Caused by: org.jboss.modules.ModuleNotFoundException: system.module:lsf"

            }}

            2019-01-22 12:10:47,295 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "IOS-ws.ear")]) - failure description: {"WFLYCTL0080: Failed services" => {

                "jboss.module.service.\"deployment.IOS-ws.ear.services-ejb.jar\".main" => "WFLYSRV0179: Failed to load module: deployment.IOS-ws.ear.services-ejb.jar

                Caused by: org.jboss.modules.ModuleNotFoundException: system.module:lsf",

                "jboss.module.service.\"deployment.IOS-ws.ear\".main" => "Failed to start service

                Caused by: java.io.UncheckedIOException: java.nio.file.AccessDeniedException: /tspenv1/law/system/module/lsf/../../backup

                Caused by: java.nio.file.AccessDeniedException: /tspenv1/law/system/module/lsf/../../backup",

                "jboss.module.service.\"deployment.IOS-ws.ear.services-ejb3.jar\".main" => "WFLYSRV0179: Failed to load module: deployment.IOS-ws.ear.services-ejb3.jar

                Caused by: org.jboss.modules.ModuleNotFoundException: system.module:lsf",

                "jboss.module.service.\"deployment.IOS-ws.ear.IOS.war\".main" => "Failed to start service

                Caused by: java.io.UncheckedIOException: java.nio.file.AccessDeniedException: /tspenv1/law/system/module/lsf/../../backup

                Caused by: java.nio.file.AccessDeniedException: /tspenv1/law/system/module/lsf/../../backup"

            }}

            2019-01-22 12:10:47,296 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "business.ear")]) - failure description: {"WFLYCTL0080: Failed services" => {

                "jboss.module.service.\"deployment.business.ear.bpm.war\".main" => "Failed to start service

                Caused by: java.io.UncheckedIOException: java.nio.file.AccessDeniedException: /tspenv1/law/system/module/lsf/../../backup

                Caused by: java.nio.file.AccessDeniedException: /tspenv1/law/system/module/lsf/../../backup",

                "jboss.module.service.\"deployment.business.ear\".main" => "WFLYSRV0179: Failed to load module: deployment.business.ear

                Caused by: org.jboss.modules.ModuleNotFoundException: system.module:lsf"

            }}

            2019-01-22 12:10:47,298 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "security.ear")]) - failure description: {"WFLYCTL0080: Failed services" => {

                "jboss.module.service.\"deployment.security.ear\".main" => "WFLYSRV0179: Failed to load module: deployment.security.ear

                Caused by: org.jboss.modules.ModuleNotFoundException: system.module:lsf",

                "jboss.module.service.\"deployment.security.ear.sso.war\".main" => "Failed to start service

                Caused by: java.io.UncheckedIOException: java.nio.file.AccessDeniedException: /tspenv1/law/system/module/lsf/../../backup

                Caused by: java.nio.file.AccessDeniedException: /tspenv1/law/system/module/lsf/../../backup",

                "jboss.module.service.\"deployment.security.ear.rmwebapp.war\".main" => "WFLYSRV0179: Failed to load module: deployment.security.ear.rmwebapp.war

                Caused by: org.jboss.modules.ModuleNotFoundException: system.module:lsf",

                "jboss.module.service.\"deployment.security.ear.scwebapp.war\".main" => "Failed to start service

                Caused by: java.io.UncheckedIOException: java.nio.file.AccessDeniedException: /tspenv1/law/system/module/lsf/../../backup

                Caused by: java.nio.file.AccessDeniedException: /tspenv1/law/system/module/lsf/../../backup",

                "jboss.module.service.\"deployment.security.ear.ssoconfig.war\".main" => "Failed to start service

                Caused by: java.io.UncheckedIOException: java.nio.file.AccessDeniedException: /tspenv1/law/system/module/lsf/../../backup

                Caused by: java.nio.file.AccessDeniedException: /tspenv1/law/system/module/lsf/../../backup"

             

             

            Thank you

            • 3. Re: Wildfly 14, Java.nio.file.AccessDeniedException Issue
              jaikiran pai Master

              Thank you for these details. Can you please add the java version details that I noted in the preivous reply:

              Which exact operating system is this and which version and vendor of Java is this? You can paste the output of:

               

              java -version

               

              That might help us reproduce this quickly.

              • 4. Re: Wildfly 14, Java.nio.file.AccessDeniedException Issue
                jaikiran pai Master

                Actually, never mind, I was able to reproduce this even with Java 8 locally. Can you create a JIRA here - JBoss Issue Tracker  and add the necessary details and point to this thread?