Commented: (WAGONFTP-8) ArrayIndexOutOfBoundsException upon deploy

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Commented: (WAGONFTP-8) ArrayIndexOutOfBoundsException upon deploy

    [ ]

John Wells commented on WAGONFTP-8:

The hanging bug has to do with the commons-net ftp client running against a windows ftp server.

This is an age-old problem (I remember working on a problem like this ten or more years ago).

The windows "ls" or "dir" command gives an *approximation* of the size of the file.  However, the actual number of bytes in the file may be different.

What is happening here is that if you do a dir (or ls) from ftp you get the following:

12-23-05 06:17AM 266 maven-metadata.xml

You would think from this that maven-metadata.xml is 266 bytes, right?  *wrong*  maven-metadata is actually 269 bytes long.  Funny, right?


What happens (I think) is that the ftp input stream reads 266 bytes and then expects an eof.  It doesn't get it, because there are still three bytes to read.  Hence, our program fails.  (You can see the real size by printing out the "inputStream.available()" result, which is 269.

I have not proved this conclusively, but I'm 90% sure this is what causes the hang.  So be happy, wagon-ftp people, looks like the bug is not you.  Now I have to go figure out how to fix the commons-net package.


John Wells (Aziz)
[hidden email]

> ArrayIndexOutOfBoundsException upon deploy
> ------------------------------------------
>          Key: WAGONFTP-8
>          URL:
>      Project: wagon-ftp
>         Type: Bug

>  Environment: Win xp, sp2
>     Reporter: Michael Fiedler

> I am trying to deploy for the first time.  I am using wagon-ftp, 1.0-alpha-4 as an extension for a maven 2 deploy goal.  The repository location (on the host) is new and empty.
> c:\...> .../bin/mvn clean:clean install deploy
> ...
> [INFO] [deploy:deploy]
> [INFO] Retrieving previous build number from M2_repo_ftp
> Uploading: ftp://host/com/company/modules/1.0-SNAPSHOT/modules-1.0-20051202.165702-1.pom
> 4K uploaded
> [INFO] Retrieving previous metadata from M2_repo_ftp
> [INFO] ----------------------------------------------------------------------------
> [INFO] ----------------------------------------------------------------------------
> [INFO] 0
> [INFO] ----------------------------------------------------------------------------
> [INFO] Trace
> java.lang.ArrayIndexOutOfBoundsException: 0
>         at org.apache.maven.wagon.providers.ftp.FtpWagon.fillInputData(
>         at org.apache.maven.wagon.StreamWagon.get(
>         at org.apache.maven.artifact.manager.DefaultWagonManager.getRemoteFile(
>         at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifactMetadata(
>         at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.resolveAlways(
>         at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.deploy(
>         at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(
>         at org.apache.maven.plugin.deploy.DeployMojo.execute(
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
>         at org.apache.maven.DefaultMaven.doExecute(
>         at org.apache.maven.DefaultMaven.execute(
>         at org.apache.maven.cli.MavenCli.main(
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>         at java.lang.reflect.Method.invoke(
>         at org.codehaus.classworlds.Launcher.launchEnhanced(
>         at org.codehaus.classworlds.Launcher.launch(
>         at org.codehaus.classworlds.Launcher.mainWithExitCode(
>         at org.codehaus.classworlds.Launcher.main(
> [INFO] ----------------------------------------------------------------------------

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]