5 Replies Latest reply on Sep 4, 2013 7:24 AM by maxandersen

    Ant's sshexec problem in JBDS

    acormond

      Running an Ant build script in JBDS 7.0.0.GA has a problem, that being that it is difficult to run the sshexec task.  Executing that task initially resulted in an error saying that it could not find the class com/jcraft/jsch/Logger.  This is in the jsch.jar file.  There is a version of this jar file in jbds/studio/plugins/org.apache.ant*/lib.  I found, however, that I could not get sshexec to work until I had both this file, and the latest version of the jsch.jar in a ".ant/lib" folder in my user folder (C:/alex/.ant/lib).  While it's working now this is not good because, 1) it was a pain in the bobo to get it working, and  2) it won't work for another user unless that user also creates a .ant/lib folder with the jsch.jar in it.

        • 1. Re: Ant's sshexec problem in JBDS
          acormond

          Same with the FTP Ant task.  Had to copy commons-net-3.3.jar to C:/users/alex/.ant

          • 2. Re: Ant's sshexec problem in JBDS
            maxandersen

            Hi Alex,

             

            Hard to reproduce your issue without an actual ant file and version info - but I was wondering if you seen this happen only with JBDS 7 or it also happens with plain Eclipse ?

             

            It sounds like this is simply a sideeffect of the version of ant used in eclipse by default ?

             

            Have you tried setting up Ant runtime in eclipse preferences to override what you are using ?

            • 3. Re: Ant's sshexec problem in JBDS
              acormond

              Hi Max,

               

              Thanks for responding.

               

              I am using JBDS Version: 7.0.0.GA

              Build id: GA-v20130720-0044-B364

               

              The jars in the jbds-7.0.0/studio/plugins/org.apache.ant_1.8.4.v2013030880030/lib are all what comes with that version of JBDS. The jars I added to C:/alex/.ant/lib were: commons-net-3.3.jar and jsch-0.1.50.jar.

               

              It may be of interest to note that in JBDS, when I right-click on the Ant build file, build.xml, then choose “Run As …” then choose the Classpath tab, the jars in the classpath are shown, of course.  But, if I copy the jars files above into this folder then restart JBDS, they don’t show up in that view.  Apparently JBDS’s class loader is not loading them.

               

              No, I haven’t set up a runtime for Ant, but the runtime for JBDS is based on jdk1.7.0_25 and Wildfly-8.0.0.Alpha4.

               

              I’ll send you  a simplified Ant build file in a minute.

               

              And, no, I don’t use pure Eclipse (or IntelliJ).

               

              Cheers,

               

              Alex

              • 4. Re: Ant's sshexec problem in JBDS
                acormond

                Did you get the build.xml file I sent?  Here it is again.

                 

                <?xml version="1.0" encoding="UTF-8"?>

                 

                <project name="Web Model 6" basedir="." >

                 

                  <!-- ============ Deployment Properties ================================= -->

                 

                  <property name="deploy.test.host" value="play" />

                  <property name="deploy.test.user" value="deploy" />

                  <property name="deploy.test.pw" value="password" />

                 

                  <!-- ============ Targets ============================================ -->

                 

                  <!-- Deploy the project to the test machine.  -->

                  <target name="testSshexec"

                          description="Test whether the sshexec task works.">

                    <echo message="Connecting to test machine using sshexec." />

                    <sshexec host="${deploy.test.host}"

                             username="${deploy.test.user}"

                             password="${deploy.test.pw}"

                             trust="true"

                             command="echo 'Im alive'" />

                   </target>

                 

                </project>

                • 5. Re: Ant's sshexec problem in JBDS
                  maxandersen

                  So I gave this a try and my findings are:

                   

                  1) I don't see any conflicting jars in any directory of JBDS - there is no org.apache.ant* afaics. Only org.eclipse.ant.* and none of those contain what I would consider conflicts. Could you point out what jars you believe is the error ?

                   

                  2) When running your script the error is pretty clear - you need to setup the jars for the specific versions of ant dependencies you need. This is how Ant (unfortunately) works.