It seems that
* the jar is transferred to the pi
* the application is started
* after it has finished ssh session is terminated

If you are using 
https://bitbucket.org/raspirecipes/raspirecipes/src/master/org.raspirecipes.helloworld/
* I cannot see the expected "Hello World"
* not sure if the remote application should stop if you havent any breakpoint 
set and there is only a single println statement in the main method

Just for test: let the java application create a local file. So you could check 
if it run by searching via ssh shell/scp explorer.


Jan



-----Ursprüngliche Nachricht-----
Von: Zahid Rahman <zahidr1...@gmail.com> 
Gesendet: Dienstag, 12. Januar 2021 14:15
An: user@ant.apache.org
Betreff: AW: sshexec defaults to port 22

As you can see from output console. I have made some progress by updating the 
remote raspberry pi operating system.
I am not sure what parameter is required to resolve this error message
  *com.jcraft.jsch.JSchException:
reject HostKey: 192.168.0.22 *.

I am pretty sure it is this code
   <sshexec host="${raspberrypi}"
             username="${username}"
             password="${password}"
             failonerror="true"
             usepty="true"
             verbose="true"
             command="java -Xdebug
-Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=y -jar 
${jar.filename}" />



*BUILD FAILED/home/zahid/Eclipse Java
Raspi/org.raspirecipes.helloworld/remotedebug.xml:29:
com.jcraft.jsch.JSchException: reject HostKey: 192.168.0.22*

Buildfile: /home/zahid/Eclipse Java
Raspi/org.raspirecipes.helloworld/remotedebug.xml
remotedebug:
     [echo] "Found application /home/zahid/Eclipse Java 
Raspi/org.raspirecipes.helloworld/target/org.raspirecipes.helloworld-0.0.1-SNAPSHOT.jar"
     [echo] "Copying application to 192.168.0.22:
~/raspirecipe/org.raspirecipes.helloworld-0.0.1-SNAPSHOT.jar"
      [scp] Connecting to 192.168.0.22:22
      [scp] done.
     [echo] "Starting
192.168.0.22:~/raspirecipe/org.raspirecipes.helloworld-0.0.1-SNAPSHOT.jar
in debug mode"
  [sshexec] Connecting to 192.168.0.22:22
  [sshexec] Connecting to 192.168.0.22 port 22
  [sshexec] Connection established
  [sshexec] Remote version string: SSH-2.0-OpenSSH_7.9p1 Raspbian-10+deb10u2
  [sshexec] Local version string: SSH-2.0-JSCH-0.1.54
  [sshexec] CheckCiphers:
aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
  [sshexec] CheckKexes:
diffie-hellman-group14-sha1,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521
  [sshexec] CheckSignatures:
ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
  [sshexec] SSH_MSG_KEXINIT sent
  [sshexec] SSH_MSG_KEXINIT received
  [sshexec] kex: server: curve25519-sha256,curve25519-sha...@libssh.org
,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
  [sshexec] kex: server:
rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519
  [sshexec] kex: server: chacha20-poly1...@openssh.com 
,aes128-ctr,aes192-ctr,aes256-ctr,aes128-...@openssh.com,
aes256-...@openssh.com
  [sshexec] kex: server: chacha20-poly1...@openssh.com 
,aes128-ctr,aes192-ctr,aes256-ctr,aes128-...@openssh.com,
aes256-...@openssh.com
  [sshexec] kex: server: umac-64-...@openssh.com,umac-128-...@openssh.com,
hmac-sha2-256-...@openssh.com,hmac-sha2-512-...@openssh.com,
hmac-sha1-...@openssh.com,umac...@openssh.com,umac-...@openssh.com
,hmac-sha2-256,hmac-sha2-512,hmac-sha1
  [sshexec] kex: server: umac-64-...@openssh.com,umac-128-...@openssh.com,
hmac-sha2-256-...@openssh.com,hmac-sha2-512-...@openssh.com,
hmac-sha1-...@openssh.com,umac...@openssh.com,umac-...@openssh.com
,hmac-sha2-256,hmac-sha2-512,hmac-sha1
  [sshexec] kex: server: none,z...@openssh.com
  [sshexec] kex: server: none,z...@openssh.com
  [sshexec] kex: server:
  [sshexec] kex: server:
  [sshexec] kex: client:
ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
  [sshexec] kex: client:
ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
  [sshexec] kex: client:
aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc
  [sshexec] kex: client:
aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc
  [sshexec] kex: client:
hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
  [sshexec] kex: client:
hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
  [sshexec] kex: client: none
  [sshexec] kex: client: none
  [sshexec] kex: client:
  [sshexec] kex: client:
  [sshexec] kex: server->client aes128-ctr hmac-sha1 none
  [sshexec] kex: client->server aes128-ctr hmac-sha1 none
  [sshexec] SSH_MSG_KEX_ECDH_INIT sent
  [sshexec] expecting SSH_MSG_KEX_ECDH_REPLY
  [sshexec] ssh_rsa_verify: signature true
  [sshexec] Disconnecting from 192.168.0.22 port 22



*BUILD FAILED/home/zahid/Eclipse Java
Raspi/org.raspirecipes.helloworld/remotedebug.xml:29:
com.jcraft.jsch.JSchException: reject HostKey: 192.168.0.22* Total time: 968 
milliseconds






I think the error is earlier while <scp>ing the jar to the PI.
It seems that an sshd is running on the pi.
Are you sure you have the right credentials? Could you login with this
username+password?

Also you could run Ant with -verbose or -debug to get more details.

The error
com.jcraft.jsch.JSchException: SSH_MSG_DISCONNECT: 2 Too many authentication 
failures comes from the underlying ssh library (jsch). But a little bit 
Googling shows that the most common problem is a wrong username/password.


Jan


-----Ursprüngliche Nachricht-----
Von: Zahid Rahman <zahidr1...@gmail.com>
Gesendet: Dienstag, 12. Januar 2021 04:27
An: user@ant.apache.org
Betreff: sshexec defaults to port 22

Hi,
I am trying to setup Eclipse Remote development on raspberry pi for Java as per 
this page . http://www.raspirecipes.org/archives/218
Unfortunately something has changed since he did . I have managed to correct 
one of the errors.

I suspect this second error is due to the sshexec   command  in the
remotedebug.xml ant build script.
For me the error message is indicating that it defaults to ssh port 22.
I hope somebody here who has an in depth understanding  of sshexec ant command 
can give me the information needed to complete my project.

my eclipse console error message  is :









*Buildfile: /home/zahid/Eclipse Java
Raspi/org.raspirecipes.helloworld/remotedebug.xmlremotedebug:     [echo]
"Found application /home/zahid/Eclipse Java 
Raspi/org.raspirecipes.helloworld/target/org.raspirecipes.helloworld-0.0.1-SNAPSHOT.jar"
   [echo] "Copying application to
192.168.0.22:~/raspirecipe/org.raspirecipes.helloworld-0.0.1-SNAPSHOT.jar"
    [scp] Connecting to 192.168.0.22:22 <http://192.168.0.22:22>BUILD 
FAILED/home/zahid/Eclipse Java
Raspi/org.raspirecipes.helloworld/remotedebug.xml:18:
com.jcraft.jsch.JSchException: SSH_MSG_DISCONNECT: 2 Too many authentication 
failures



*remotedebug.xml file:*

<?xml version="1.0" encoding="UTF-8"?>
<project name="deploy" default="remotedebug" basedir=".">
  <property name="raspberrypi" value="192.168.0.22" />  <property 
name="raspberryfolder"
value="~/raspirecipe" />
  <property name="username" value="pi" />
  <property name="password" value="raspberry" />

  <target name="remotedebug">
    <first id="jars">
      <fileset dir="target" includes="**/*.jar" />
    </first>
    <pathconvert pathsep="," property="jar.path" refid="jars" />
    <basename file="${jar.path}" property="jar.filename" />
    <echo>"Found application ${jar.path}"</echo>

    <echo>"Copying application to
${raspberrypi}:${raspberryfolder}/${jar.filename}"</echo>
    <scp localfile="${jar.path}"
todir="${username}:${password}@${raspberrypi}:${raspberryfolder}"
trust="true" />

    <echo>"Starting ${raspberrypi}:${raspberryfolder}/${jar.filename}
in debug mode"</echo>

    <sshexec host="${raspberrypi}"
             username="${username}"
             password="${password}"
             failonerror="true"
             usepty="true"
             command="java -Xdebug
-Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=y -jar 
${jar.filename}" />
  </target>
</project>


<http://www.backbutton.co.uk>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional 
commands, e-mail: user-h...@ant.apache.org

<http://www.backbutton.co.uk>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org

Reply via email to