Uploaded image for project: 'Maven Wagon'
  1. Maven Wagon
  2. WAGON-257

java.lang.ArrayIndexOutOfBoundsException: 0 when deploying via scp

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 1.0-beta-5
    • Fix Version/s: None
    • Component/s: wagon-ssh
    • Labels:
      None
    • Environment:
      Mac OS X 10.4

      Description

      (Not sure about the version of wagon, I am using Maven 2.1.0 release)

      When I try to deploy something that is supposed to use scp as the protocol, for example "mvn site:deploy", I get the following exception

      --8<--
      [INFO] [site:deploy]
      Using private key: /xxx/.ssh/id_rsa
      scp://people.apache.org/www/turbine.apache.org/fulcrum/fulcrum-localization/ - Session: Connection refused
      scp://people.apache.org/www/turbine.apache.org/fulcrum/fulcrum-localization/ - Session: Disconnecting
      scp://people.apache.org/www/turbine.apache.org/fulcrum/fulcrum-localization/ - Session: Disconnected
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] Error uploading site

      Embedded error: Cannot connect. Reason: java.lang.ArrayIndexOutOfBoundsException: 0
      [INFO] ------------------------------------------------------------------------
      [INFO] Trace
      org.apache.maven.lifecycle.LifecycleExecutionException: Error uploading site
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:703)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:553)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:523)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      Caused by: org.apache.maven.plugin.MojoExecutionException: Error uploading site
      at org.apache.maven.plugins.site.SiteDeployMojo.execute(SiteDeployMojo.java:215)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
      ... 16 more
      Caused by: org.apache.maven.wagon.authentication.AuthenticationException: Cannot connect. Reason: java.lang.ArrayIndexOutOfBoundsException: 0
      at org.apache.maven.wagon.providers.ssh.jsch.AbstractJschWagon.openConnectionInternal(AbstractJschWagon.java:137)
      at org.apache.maven.wagon.AbstractWagon.openConnection(AbstractWagon.java:105)
      at org.apache.maven.wagon.AbstractWagon.connect(AbstractWagon.java:207)
      at org.apache.maven.wagon.AbstractWagon.connect(AbstractWagon.java:142)
      at org.apache.maven.plugins.site.SiteDeployMojo.execute(SiteDeployMojo.java:184)
      ... 18 more
      Caused by: com.jcraft.jsch.JSchException: java.lang.ArrayIndexOutOfBoundsException: 0
      at com.jcraft.jsch.IdentityFile.<init>(IdentityFile.java:336)
      at com.jcraft.jsch.IdentityFile.newInstance(IdentityFile.java:135)
      at com.jcraft.jsch.IdentityFile.newInstance(IdentityFile.java:130)
      at com.jcraft.jsch.JSch.addIdentity(JSch.java:200)
      at com.jcraft.jsch.JSch.addIdentity(JSch.java:194)
      at org.apache.maven.wagon.providers.ssh.jsch.AbstractJschWagon.openConnectionInternal(AbstractJschWagon.java:133)
      ... 22 more
      Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
      at com.jcraft.jsch.IdentityFile.<init>(IdentityFile.java:316)
      ... 27 more
      --8<--

      This is reproducible. The protocol scpexe works fine. My setup is as follows

      settings.xml:
      --8<--
      <server>
      <id>apache.website</id>
      <username>xx</username>
      <filePermissions>664</filePermissions>
      <directoryPermissions>775</directoryPermissions>
      </server>
      --8<--

      pom.xml
      --8<--
      <distributionManagement>
      <site>
      <id>apache.website</id>
      <name>Fulcrum Website</name>
      <url>scp://people.apache.org/www/turbine.apache
      .org/fulcrum/fulcrum-localization/</url>
      </site>
      </distributionManagement>
      --8<--

      It might be important that the user name at my local machine and the username at the remote machine are different. Obviously maven selects the correct private key to connect and then fails for whatever reason. Logging in to the remote machine with ssh works fine. I have a ssh-agent running. When using scpexe instead of scp in the otherwise unchanged environment, deploying works. The behavior is exactly the same with maven 2.0.8.

        Attachments

          Activity

            People

            • Assignee:
              olamy Olivier Lamy
              Reporter:
              tv Thomas Vandahl
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: