Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-44599

Cannot deploy to Weblogic from build slave: Parameter 'directory' is not a directory

    Details

    • Similar Issues:

      Description

      We're migrating from a master-only Jenkins server to build slaves. When trying to run a deployment to a Weblogic server the plugin fails with

      java.lang.IllegalArgumentException: Parameter 'directory' is not a directory
      

      The artifacts have been successfully downloaded into the workspace before.

      More details:

      [WeblogicDeploymentPlugin] - Pay attention to JDK version {selected version is 1.8.0_131} compatibility with WebLogic Deployer API (see Oracle documentation).
      [WeblogicDeploymentPlugin] - The JDK /usr/java/latest will be used.
      [WeblogicDeploymentPlugin] - Retrieving artifacts recorded [filtered resources on my-service.war]...
      java.lang.IllegalArgumentException: Parameter 'directory' is not a directory
      at org.apache.commons.io.FileUtils.validateListFilesParameters(FileUtils.java:545)
      at org.apache.commons.io.FileUtils.listFiles(FileUtils.java:521)
      at org.apache.commons.io.FileUtils.listFiles(FileUtils.java:691)
      at org.jenkinsci.plugins.deploy.weblogic.FreeStyleJobArtifactSelectorImpl.selectArtifactRecorded(FreeStyleJobArtifactSelectorImpl.java:46)
      at org.jenkinsci.plugins.deploy.weblogic.task.DeploymentTaskServiceImpl.perform(DeploymentTaskServiceImpl.java:129)
      at org.jenkinsci.plugins.deploy.weblogic.WeblogicDeploymentPlugin.perform(WeblogicDeploymentPlugin.java:304)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
      at hudson.model.Build$BuildExecution.post2(Build.java:186)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
      at hudson.model.Run.execute(Run.java:1753)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:405)
      ERROR: [WeblogicDeploymentPlugin] - Failed to get artifact from archive directory.
      

      Job configuration:

      <org.jenkinsci.plugins.deploy.weblogic.data.DeploymentTask>
      <id>Oexmq1owvz</id>
      <weblogicEnvironmentTargetedName>international-wls-dev</weblogicEnvironmentTargetedName>
      <deploymentName>rest-services-dach</deploymentName>
      <deploymentTargets>dach</deploymentTargets>
      <isLibrary>false</isLibrary>
      <builtResourceRegexToDeploy>my-service.war</builtResourceRegexToDeploy>
      <baseResourcesGeneratedDirectory></baseResourcesGeneratedDirectory>
      <taskName>undeploy-rest-services-dach</taskName>
      <jdk>
      <name>system</name>
      <home>/usr/java/latest</home>
      <properties/>
      </jdk>
      <stageMode>bydefault</stageMode>
      <commandLine>-adminurl t3://{wl.host}:{wl.port} -user {wl.login} -password {wl.password} -debug -remote -verbose -name {wl.deployment_name} -targets {wl.targets} -undeploy;</commandLine>
      <deploymentPlan></deploymentPlan>
      <protocol>t3</protocol>
      </org.jenkinsci.plugins.deploy.weblogic.data.DeploymentTask>
      

      When running on the master, deployment succeeds.

      What's wrong?

        Attachments

          Issue Links

            Activity

            Hide
            raphc Raphael CHAUMIER added a comment - - edited

            Hi

            The plugin doesn't support master-slave architecture yet. 

            Coming soon...

            Show
            raphc Raphael CHAUMIER added a comment - - edited Hi The plugin doesn't support master-slave architecture yet.  Coming soon...
            Hide
            raphc Raphael CHAUMIER added a comment - - edited

            Juste a trace for future enhancement...

             

            This piece of code seems to be the culprit. 'worspace.toURI()' should return  a wrong path in case of master-slave architecture?

             

            i{{f(StringUtils.isBlank(baseDirectory)){ }}

            {{FilePath workspace = build.getWorkspace(); }}

            {{baseDirName = workspace.getName(); }}

            {{filesToCheck = FileUtils.listFiles(new File(workspace.toURI()), null, true); }}

            }

             

            The main idea is to copy libraries declared in global configuration (weblogic.jar...) into workspace before launching command. No path (relative or absolute) to specify, we just take WORKSPACE directory and append list of libraries.

             

             

            Show
            raphc Raphael CHAUMIER added a comment - - edited Juste a trace for future enhancement...   This piece of code seems to be the culprit. 'worspace.toURI()' should return  a wrong path in case of master-slave architecture?   i{{f(StringUtils.isBlank(baseDirectory)){ }} {{FilePath workspace = build.getWorkspace(); }} {{baseDirName = workspace.getName(); }} {{filesToCheck = FileUtils.listFiles(new File(workspace.toURI()), null, true); }} }   The main idea is to copy libraries declared in global configuration (weblogic.jar...) into workspace before launching command. No path (relative or absolute) to specify, we just take WORKSPACE directory and append list of libraries.    
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rachaumi
            Path:
            src/main/java/org/jenkinsci/plugins/deploy/weblogic/WeblogicDeploymentPlugin.java
            src/main/java/org/jenkinsci/plugins/deploy/weblogic/deployer/WebLogicDeployer.java
            src/main/java/org/jenkinsci/plugins/deploy/weblogic/jdk/JdkToolService.java
            src/main/java/org/jenkinsci/plugins/deploy/weblogic/task/DeploymentTaskServiceImpl.java
            src/main/resources/org/jenkinsci/plugins/deploy/weblogic/WeblogicDeploymentPlugin/global.jelly
            http://jenkins-ci.org/commit/weblogic-deployer-plugin/8ff1f8782eaa733328034827697023c1271320cd
            Log:
            JENKINS-44599 Support master-slave architecture

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rachaumi Path: src/main/java/org/jenkinsci/plugins/deploy/weblogic/WeblogicDeploymentPlugin.java src/main/java/org/jenkinsci/plugins/deploy/weblogic/deployer/WebLogicDeployer.java src/main/java/org/jenkinsci/plugins/deploy/weblogic/jdk/JdkToolService.java src/main/java/org/jenkinsci/plugins/deploy/weblogic/task/DeploymentTaskServiceImpl.java src/main/resources/org/jenkinsci/plugins/deploy/weblogic/WeblogicDeploymentPlugin/global.jelly http://jenkins-ci.org/commit/weblogic-deployer-plugin/8ff1f8782eaa733328034827697023c1271320cd Log: JENKINS-44599 Support master-slave architecture
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rachaumi
            Path:
            src/main/java/org/jenkinsci/plugins/deploy/weblogic/deployer/WebLogicDeployer.java
            src/main/java/org/jenkinsci/plugins/deploy/weblogic/task/DeploymentTaskServiceImpl.java
            src/main/java/org/jenkinsci/plugins/deploy/weblogic/util/DeployerClassPathUtils.java
            http://jenkins-ci.org/commit/weblogic-deployer-plugin/307c57fb40d2d864f2fe10f6035f69c571fa6b6d
            Log:
            JENKINS-44599 Copie classpath librairies on node

            Compare: https://github.com/jenkinsci/weblogic-deployer-plugin/compare/c420ee16f2de...307c57fb40d2

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rachaumi Path: src/main/java/org/jenkinsci/plugins/deploy/weblogic/deployer/WebLogicDeployer.java src/main/java/org/jenkinsci/plugins/deploy/weblogic/task/DeploymentTaskServiceImpl.java src/main/java/org/jenkinsci/plugins/deploy/weblogic/util/DeployerClassPathUtils.java http://jenkins-ci.org/commit/weblogic-deployer-plugin/307c57fb40d2d864f2fe10f6035f69c571fa6b6d Log: JENKINS-44599 Copie classpath librairies on node Compare: https://github.com/jenkinsci/weblogic-deployer-plugin/compare/c420ee16f2de...307c57fb40d2
            Hide
            raphc Raphael CHAUMIER added a comment -

            Hi Stephan Austermühle

             

            What is the value of the parameter baseResourcesGeneratedDirectory in your task ?

             

            Regards,

            Show
            raphc Raphael CHAUMIER added a comment - Hi Stephan Austermühle   What is the value of the parameter baseResourcesGeneratedDirectory in your task ?   Regards,
            Hide
            raphc Raphael CHAUMIER added a comment -

            Hi Stephan Austermühle

             

            I can reproduce the bug if I don't set any value in baseResourcesGeneratedDirectory

            Show
            raphc Raphael CHAUMIER added a comment - Hi Stephan Austermühle   I can reproduce the bug if I don't set any value in baseResourcesGeneratedDirectory
            Hide
            raphc Raphael CHAUMIER added a comment -

            Hi Stephan Austermühle

            I've just released the version 4.0. Let me know if it's ok for you.

            Show
            raphc Raphael CHAUMIER added a comment - Hi Stephan Austermühle I've just released the version 4.0. Let me know if it's ok for you.
            Hide
            raphc Raphael CHAUMIER added a comment -

            No news I consider the issue as resolved

            Show
            raphc Raphael CHAUMIER added a comment - No news I consider the issue as resolved

              People

              • Assignee:
                raphc Raphael CHAUMIER
                Reporter:
                stephan Stephan Austermühle
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: