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

Un-escaped $ in module file name passed in command line to weblogic.jar results in the input file not found deployer

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • Linux

      My build utput produced by "mvn install" looks a bit like this:

      /home/ca31319/archdata/jenkins/jobs/Epdservices/modules/org.delta$org.delta.epd.services/builds/2014-01-06_14-08-56/archive/org.delta/org.delta.epd.services/1.0-SNAPSHOT/org.delta.epd.services-1.0-SNAPSHOT.war

      Notice the "$" in the module result.

      This file name is passed on the command line to weblogic.jar without the "$" being escaped - hence the file is not found.

      /usr/java/jdk1.7.0_45/jre/bin/java -Xms256M -Xmx256M -cp /opt/oracle/wls12120/wlserver/server/lib/weblogic.jar weblogic.Deployer -debug -stage -remote -verbose -upload -name "EPD Services" -source /home/ca31319/archdata/jenkins/jobs/Epdservices/modules/org.delta$org.delta.epd.services/builds/2014-01-06_14-08-56/archive/org.delta/org.delta.epd.services/1.0-SNAPSHOT/org.delta.epd.services-1.0-SNAPSHOT.war -targets myserver -adminurl t3://myhost:7001 -user weblogic -password mypassword -deploy

      If I cut and paste this into a terminal and escape the $ - it works fine.

      Please could you provide a fix?

          [JENKINS-21244] Un-escaped $ in module file name passed in command line to weblogic.jar results in the input file not found deployer

          Adrian Blakey created issue -
          Adrian Blakey made changes -
          Description New: My build utput produced by "mvn install" looks a bit like this:

          /home/ca31319/archdata/jenkins/jobs/Epdservices/modules/org.delta$org.delta.epd.services/builds/2014-01-06_14-08-56/archive/org.delta/org.delta.epd.services/1.0-SNAPSHOT/org.delta.epd.services-1.0-SNAPSHOT.war

          Notice the "$" in the module result.

          This file name is passed on the command line to weblogic.jar without the "$" being escaped - hence the file is not found.

          /usr/java/jdk1.7.0_45/jre/bin/java -Xms256M -Xmx256M -cp /opt/oracle/wls12120/wlserver/server/lib/weblogic.jar weblogic.Deployer -debug -stage -remote -verbose -upload -name "EPD Services" -source /home/ca31319/archdata/jenkins/jobs/Epdservices/modules/org.delta$org.delta.epd.services/builds/2014-01-06_14-08-56/archive/org.delta/org.delta.epd.services/1.0-SNAPSHOT/org.delta.epd.services-1.0-SNAPSHOT.war -targets myserver -adminurl t3://rc-lx433.ut.dentegra.lab:7001 -user weblogic -password weblogic001 -deploy

          If I cut and paste this into a terminal and escape the $ - it works fine.

          Please could you provide a fix?
          Environment New: Linux
          Raphael CHAUMIER made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Raphael CHAUMIER made changes -
          Labels New: weblogic-deployer-plugin-2.10
          Raphael CHAUMIER made changes -
          Labels Original: weblogic-deployer-plugin-2.10 New: weblogic-deployer-plugin-2.11

          Jaap Coomans added a comment -

          A "fix" for this issue broke the functionality of the plugin for me.

          In src/main/java/org/jenkinsci/plugins/deploy/weblogic/deployer/WebLogicDeployer.java the following line is added:

          args.add("\""+ parameter.getSource()+"\"");
          

          The result is that the source parameter is passed with two pairs of quotes (""/path/to/file""), of which the inner pair remains in the String that is being processed by the WebLogic deployer.
          This finally results in a FileNotFoundException:

          java.io.FileNotFoundException: /"/var/opt/jenkins/workspace/sample-project/target/sample-project-0.1.0-SNAPSHOT.war" (No such file or directory)
          	at java.io.FileInputStream.open(Native Method)
          	at java.io.FileInputStream.(FileInputStream.java:131)
          	at weblogic.utils.FileUtils.copy(FileUtils.java:266)
          	at weblogic.utils.FileUtils.copy(FileUtils.java:245)
          	at weblogic.utils.FileUtils.copy(FileUtils.java:186)
          	at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl.upload(ServerConnectionImpl.java:849)
          	at weblogic.deploy.api.spi.deploy.internal.BasicOperation.uploadFiles(BasicOperation.java:332)
          	at weblogic.deploy.api.spi.deploy.internal.BasicOperation.execute(BasicOperation.java:465)
          	at weblogic.deploy.api.spi.deploy.internal.BasicOperation.run(BasicOperation.java:178)
          	at weblogic.deploy.api.spi.deploy.WebLogicDeploymentManagerImpl.deploy(WebLogicDeploymentManagerImpl.java:390)
          	at weblogic.deploy.api.tools.deployer.DeployOperation.execute(DeployOperation.java:51)
          	at weblogic.deploy.api.tools.deployer.Deployer.perform(Deployer.java:139)
          	at weblogic.deploy.api.tools.deployer.Deployer.runBody(Deployer.java:88)
          	at weblogic.utils.compiler.Tool.run(Tool.java:158)
          	at weblogic.utils.compiler.Tool.run(Tool.java:115)
          	at weblogic.Deployer.run(Deployer.java:74)
          	at weblogic.Deployer.main(Deployer.java:55)
          

          Jaap Coomans added a comment - A "fix" for this issue broke the functionality of the plugin for me. In src/main/java/org/jenkinsci/plugins/deploy/weblogic/deployer/WebLogicDeployer.java the following line is added: args.add( "\" "+ parameter.getSource()+" \""); The result is that the source parameter is passed with two pairs of quotes ( ""/path/to/file"" ), of which the inner pair remains in the String that is being processed by the WebLogic deployer. This finally results in a FileNotFoundException: java.io.FileNotFoundException: /"/var/opt/jenkins/workspace/sample-project/target/sample-project-0.1.0-SNAPSHOT.war" (No such file or directory) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.(FileInputStream.java:131) at weblogic.utils.FileUtils.copy(FileUtils.java:266) at weblogic.utils.FileUtils.copy(FileUtils.java:245) at weblogic.utils.FileUtils.copy(FileUtils.java:186) at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl.upload(ServerConnectionImpl.java:849) at weblogic.deploy.api.spi.deploy.internal.BasicOperation.uploadFiles(BasicOperation.java:332) at weblogic.deploy.api.spi.deploy.internal.BasicOperation.execute(BasicOperation.java:465) at weblogic.deploy.api.spi.deploy.internal.BasicOperation.run(BasicOperation.java:178) at weblogic.deploy.api.spi.deploy.WebLogicDeploymentManagerImpl.deploy(WebLogicDeploymentManagerImpl.java:390) at weblogic.deploy.api.tools.deployer.DeployOperation.execute(DeployOperation.java:51) at weblogic.deploy.api.tools.deployer.Deployer.perform(Deployer.java:139) at weblogic.deploy.api.tools.deployer.Deployer.runBody(Deployer.java:88) at weblogic.utils.compiler.Tool.run(Tool.java:158) at weblogic.utils.compiler.Tool.run(Tool.java:115) at weblogic.Deployer.run(Deployer.java:74) at weblogic.Deployer.main(Deployer.java:55)

          A performed a rollback on the unexpected commit. The fixed version is 2.11
          Sorry

          Raphael CHAUMIER added a comment - A performed a rollback on the unexpected commit. The fixed version is 2.11 Sorry
          Raphael CHAUMIER made changes -
          Labels Original: weblogic-deployer-plugin-2.11 New: weblgoc-deployer-plugin-2.13

          Jaap Coomans added a comment -

          Thank you for the very quick response and resolution!

          Jaap Coomans added a comment - Thank you for the very quick response and resolution!
          Raphael CHAUMIER made changes -
          Labels Original: weblgoc-deployer-plugin-2.13 New: weblogic-deployer-plugin-2.14

            mgarrido Manuel J. Garrido
            adrianblakey Adrian Blakey
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: