IncomingFileTransfer recieveFile(..) throws "error in execution"

Below is my client test result using smack-4.1.0-beta2-SNAPSHOT-2015-01-14:

Debugging/single-stepping into the receiveFile, I have observed streamNogotiatorTask.get(…) throws an ExecutionException “Error in execution”. Depth-wise on the stack frame, it looks like there is NullPointerException down in Sock5TransferNegotiator, “Cannot evaluate org.jivesoftware.smackx.filetransfer.Socks5TransferNegotiator$BytestreamSIDFilt er.toString()”. Also, a similar kind of problem for In-band was observed.

To contrast, when using PSI client to receive file, PSI can negotiate and receive both XEP-0047 In-Band Bytestrean or XEP-0065 SOCKS5 without error. Of course PSI is not a Smack implementation but the fact that beta2 cannot handle receiving a file provides additional proof there is problem with the receiveFile(…) implementation of Smack or there is a problem with my implementation.

  • My sender and receiver processes are executing on the same machine.
  • XMPP Server is Openfire 3.6.3 and is not running on the same machine as the (clients)

My beta2 client calls receiveFile:

  • public void recieveFile(final File file) throws SmackException, IOException

receiveFile then calls negotiateStream:

  • private InputStream negotiateStream() throws SmackException, XMPPErrorException

streamNegotiatorTask**.run()****;**

InputStream inputStream;
try {

inputStream = (InputStream)streamNegotiatorTask.get(15L, TimeUnit.SECONDS)****;
} catch (InterruptedException var10) {

throw new SmackException(“Interruption while executing”, var10);
} catch (ExecutionException var11) {

** throw new SmackException(“Error in execution”, var11)****; // <<=== Fails to receive file, throws here**
} catch (TimeoutException var12) {

throw new SmackException(“Request timed out”, var12);
} finally {

streamNegotiatorTask.cancel(true);
}

Thanks for your detailed report. Could you

  1. Update to 4.1.0-rc1

  2. Show exception causing the ExecutionException causing the SmackException, and its stacktrace?

For example via

SmackException exception = …

ExecutionException executionException = exception.getCause();

if (exceutionException != null) { // this should be not null

Exception causingException = executionException.getCause();

causingException.printStackTrace(); // or log

}

Not sure what version “4.1.0-rc1” denotes, so I tested with nightly smack-4.1.0-beta3-SNAPSHOT-2015-02-12. Per your request, below is trace from getCause() . Regression tested with previous smack-4.1.0-beta2-SNAPSHOT-2015-01-14 and results were same as below. Also included Raw Sent Packets and Raw Received Packets via SmackConfiguration.DEBUG = true, and my java class that implements FileTransferListener interface.

**trace from getCause() **

-------------------------------------

Connected to the target VM, address: ‘127.0.0.1:*****’, transport: ‘socket’

Connecting to XMPP Server.

test-receiver@test.tester.net/Smack now connected to 10...****

Added supported discovery features.

Added IQ extension providers required to parse file transfer stanzas.

Started listening

file named: some.txt

File transfer accepted for stream Id jsi_754030307435725279

File transfer NEGOTIATING STREAM

File transfer NEGOTIATING STREAM

org.jivesoftware.smack.SmackException: org.jivesoftware.smack.SmackException$NoResponseException: No response received within packet reply timeout. Timeout was 5000ms (~5s)

File transfer ERROR

Transfer exception occurred: org.jivesoftware.smack.SmackException: Error in execution

at org.jivesoftware.smackx.filetransfer.FaultTolerantNegotiator.createIncomingStre am(FaultTolerantNegotiator.java:119)

at org.jivesoftware.smackx.filetransfer.IncomingFileTransfer$2.call(IncomingFileTr ansfer.java:186)

at org.jivesoftware.smackx.filetransfer.IncomingFileTransfer$2.call(IncomingFileTr ansfer.java:183)

at java.util.concurrent.FutureTask.run(FutureTask.java:262)

at org.jivesoftware.smackx.filetransfer.IncomingFileTransfer.negotiateStream(Incom ingFileTransfer.java:190)

at org.jivesoftware.smackx.filetransfer.IncomingFileTransfer.access$100(IncomingFi leTransfer.java:57)

at org.jivesoftware.smackx.filetransfer.IncomingFileTransfer$1.run(IncomingFileTra nsfer.java:129)

at java.lang.Thread.run(Thread.java:745)

Caused by: org.jivesoftware.smack.SmackException$NoResponseException: No response received within packet reply timeout. Timeout was 5000ms (~5s)

at org.jivesoftware.smackx.filetransfer.FaultTolerantNegotiator$NegotiatorService. call(FaultTolerantNegotiator.java:181)

at org.jivesoftware.smackx.filetransfer.FaultTolerantNegotiator$NegotiatorService. call(FaultTolerantNegotiator.java:170)

at java.util.concurrent.FutureTask.run(FutureTask.java:262)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

at java.util.concurrent.FutureTask.run(FutureTask.java:262)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

… 1 more

Raw Sent Packets

--------------------------

<stream:stream xmlns=‘jabber:client’ to=‘test.tester.net’ xmlns:stream=‘http://etherx.jabber.org/streams’ version=‘1.0’ from=‘test-receiver@test.tester.net’ xml:lang=‘en’>

=

Y2hhcnNldD11dGYtOCx1c2VybmFtZT0icmFkLW Rpc2NvdmVyeS1yZWNlaXZlciIscmVhbG09InRhbGtpbnQuZW5lcm5vYy5uZXQiLG5vbmNlPSJUVjc3aH ZqN0Y0T3VQZ2JvcEZPQ0JwS0dWaWVJNzAzR1FSSzU0Rnc3IixuYz0wMDAwMDAwMSxjbm9uY2U9InJyam p1MlFSUFNiSFZGV2hxcjFPblJiK01ycGNmeThRNlZueDJQbEEiLGRpZ2VzdC11cmk9InhtcHAvdGFsa2 ludC5lbmVybm9jLm5ldCIsbWF4YnVmPTY1NTM2LHJlc3BvbnNlPWUyNGY1YzRlMmZjYzIwZWFkZjgwZW YwYjBiMTk1ODA4LHFvcD1hdXRo

<stream:stream xmlns=‘jabber:client’ to=‘test.tester.net’ xmlns:stream=‘http://etherx.jabber.org/streams’ version=‘1.0’ from=‘rad-discovery-receiver@test.tester.net’ id=‘87ee150’ xml:lang=‘en’>

Smack

http://jabber.org/protocol/bytestreams

http://jabber.org/protocol/ibb

<feature var='http://jabber.org/protocol/commands’/>

<feature var='http://jabber.org/protocol/file-transfer’/>

<feature var='http://jabber.org/protocol/xhtml-im’/>

<feature var='http://jabber.org/protocol/disco#items’/>

<feature var='http://jabber.org/protocol/bytestreams’/>

<feature var='http://jabber.org/protocol/ibb’/>

<feature var='http://jabber.org/protocol/muc’/>

<feature var='http://jabber.org/protocol/si’/>

<feature var='http://jabber.org/protocol/xdata-validate’/>

<feature var='http://jabber.org/protocol/xdata-layout’/>

<feature var='http://jabber.org/protocol/si/profile/file-transfer’/>

<feature var='http://jabber.org/protocol/disco#info’/>

Raw Received Packets

---------------------------------

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

stream:featuresDIGEST-MD5PLAINCRAM-MD5zlib</stream:features>

cmVhbG09InRhbGtpbnQuZW5lcm5vYy5uZXQiLG 5vbmNlPSJUVjc3aHZqN0Y0T3VQZ2JvcEZPQ0JwS0dWaWVJNzAzR1FSSzU0Rnc3Iixxb3A9ImF1dGgiLG NoYXJzZXQ9dXRmLTgsYWxnb3JpdGhtPW1kNS1zZXNz

cnNwYXV0aD0xMDliYzE0YWQzNjEzZWFlZjg2Nj c1NWI0NmMwNTI1Yw==

<?xml version='1.0' encoding='UTF-8'?>zlib

test-receiver@test.tester.net/Smack

file named: some.txt

http://jabber.org/protocol/bytestreams

http://jabber.org/protocol/ibb

Implementation of FileTransferListener

----------------------------------------------------------

package com.test.tester;

import org.jivesoftware.smack.AbstractXMPPConnection;

import org.jivesoftware.smack.SmackException;

import org.jivesoftware.smack.provider.ProviderManager;

import org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream;

import org.jivesoftware.smackx.bytestreams.socks5.provider.BytestreamsProvider;

import org.jivesoftware.smackx.commands.provider.AdHocCommandDataProvider;

import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;

import org.jivesoftware.smackx.disco.provider.DiscoverInfoProvider;

import org.jivesoftware.smackx.disco.provider.DiscoverItemsProvider;

import org.jivesoftware.smackx.filetransfer.*;

import org.jivesoftware.smackx.privacy.provider.PrivacyProvider;

import org.jivesoftware.smackx.si.provider.StreamInitiationProvider;

import java.io.File;

import java.util.UUID;

import java.util.concurrent.ExecutionException;

class Listener implements FileTransferListener

{

public Listener(AbstractXMPPConnection receiverConnection, String directory)

{

    connection = receiverConnection;

    directoryToSaveFile = directory;

    serviceDiscoveryManager = null;

    manager = FileTransferManager.getInstanceFor(this.connection);

}

private AbstractXMPPConnection connection;

private ServiceDiscoveryManager serviceDiscoveryManager;

private String directoryToSaveFile;

private FileTransferManager manager;

public void AddServiceDiscoveryManagerFeatures()

{

    serviceDiscoveryManager = ServiceDiscoveryManager.getInstanceFor(connection);

    serviceDiscoveryManager.addFeature("[http://jabber.org/protocol/disco#info](http://jabber.org/protocol/disco#info)");

    serviceDiscoveryManager.addFeature("jabber:iq:privacy");

    serviceDiscoveryManager.addFeature("[http://jabber.org/protocol/file-transfer](http://jabber.org/protocol/file-transfer)");

    serviceDiscoveryManager.addFeature("[http://jabber.org/protocol/si](http://jabber.org/protocol/si)");

    serviceDiscoveryManager.addFeature("[http://jabber.org/protocol/bytestreams](http://jabber.org/protocol/bytestreams)");

    //serviceDiscoveryManager.addFeature("[http://jabber.org/protocol/ibb](http://jabber.org/protocol/ibb)");

    System.out.println("Added supported discovery features.");

}

public void AddIQExtensionProviders()

{

    ProviderManager.addIQProvider("query", "[http://jabber.org/protocol/disco#items](http://jabber.org/protocol/disco#items)", new DiscoverItemsProvider());

    ProviderManager.addIQProvider("query", "[http://jabber.org/protocol/disco#info](http://jabber.org/protocol/disco#info)", new DiscoverInfoProvider());

    ProviderManager.addIQProvider("query", "jabber:iq:privacy", new PrivacyProvider());

    ProviderManager.addIQProvider("malformed-action", "[http://jabber.org/protocol/commands](http://jabber.org/protocol/commands)", new AdHocCommandDataProvider());

    ProviderManager.addIQProvider("si", "[http://jabber.org/protocol/si](http://jabber.org/protocol/si)", new StreamInitiationProvider());

    //Parses a bytestream packet

    //ProviderManager.addIQProvider("query", "[http://jabber.org/protocol/bytestreams](http://jabber.org/protocol/bytestreams)", new BytestreamsProvider());

    ProviderManager.addIQProvider(Bytestream.QUERY_ELEMENT, Bytestream.NAMESPACE, new BytestreamsProvider());

    ProviderManager.addIQProvider(Bytestream.StreamHost.ELEMENTNAME, Bytestream.NAMESPACE, new BytestreamsProvider());

    ProviderManager.addIQProvider(Bytestream.StreamHostUsed.ELEMENTNAME, Bytestream.NAMESPACE, new BytestreamsProvider());

    //Parses an In-Band Bytestream open packet.

    //TODO: don't understand what IQProviders to use for IIB. This is not an asmack app, just desktop machine on Win7. Skipping IIB for now...

    //ProviderManager.addIQProvider("open", "[http://jabber.org/protocol/ibb](http://jabber.org/protocol/ibb)", new OpenIQProvider());

    //ProviderManager.addIQProvider("data", "[http://jabber.org/protocol/ibb](http://jabber.org/protocol/ibb)", new DataPacketProvider.IQProvider());

    //ProviderManager.addIQProvider("close", "[http://jabber.org/protocol/ibb](http://jabber.org/protocol/ibb)", new CloseIQProvider());

    //ProviderManager.addExtensionProvider("data", "[http://jabber.org/protocol/ibb](http://jabber.org/protocol/ibb)", new DataPacketProvider.PacketExtensionProvider());

    System.out.println("Added IQ extension providers required to parse file transfer stanzas.");

}

public void startListening()

{

    System.out.println("Started listening");

    manager.addFileTransferListener(this);

}

public void stopListening()

{

    manager.removeFileTransferListener(this);

    System.out.println("Stopped listening");

}

/**

 * Required implementation of interface. This is where the file transfer takes place

 * @see FileTransferListener

 * @param fileTransferRequest

 */

@Override

**public void fileTransferRequest(FileTransferRequest fileTransferRequest)**

{

    try

    {

        final String uniqueFilename = String.format("%s_%s",UUID.randomUUID().toString(), fileTransferRequest.getFileName() );

        final File file = new File( directoryToSaveFile +  uniqueFilename );

        System.out.println(fileTransferRequest.getDescription());

        **IncomingFileTransfer transfer = fileTransferRequest.accept();**

        System.out.println("File transfer accepted for stream Id " + fileTransferRequest.getStreamID());

/*** tried this approach, get same transfer error

        InputStream inputStream = transfer.recieveFile();

        byte[] buffer = new byte[inputStream.available()];

        inputStream.read(buffer);

        File targetFile = new File(directoryToSaveFile +  uniqueFilename );

        OutputStream outStream = new FileOutputStream(targetFile);

        outStream.write(buffer);

***/

        **transfer.recieveFile(file);** //give handle to file sys, which streams out buffered contents

        while (!transfer.isDone())

        {

            Thread.sleep(2000L);

            if (transfer.getStatus().equals(FileTransfer.Status.cancelled)) {

                System.out.println("File transfer CANCELLED");

            }

            if (transfer.getStatus().equals(FileTransfer.Status.complete)) {

                System.out.println("File transfer COMPLETE");

            }

            if (transfer.getStatus().equals(FileTransfer.Status.error)) {

                System.out.println("File transfer ERROR");

                transfer.cancel();

            }

            if (transfer.getStatus().equals(FileTransfer.Status.in_progress)) {

                System.out.println("File transfer IN PROGRESS");

            }

            if (transfer.getStatus().equals(FileTransfer.Status.negotiating_transfer)) {

                System.out.println("File transfer IN NEGOTIATING");

            }

            if (transfer.getStatus().equals(FileTransfer.Status.initial)) {

                System.out.println("File now transfer INITIAL");

            }

            if (transfer.getStatus().equals(FileTransfer.Status.negotiating_stream)) {

                System.out.println("File transfer NEGOTIATING STREAM");

            }

            if (transfer.getStatus().equals(FileTransfer.Status.refused)) {

                System.out.println("File transfer REFUSED");

            }

        }

        FileTransfer.Error transferError = transfer.getError();

        if (transferError != null)

        {

            System.out.println(transferError.getMessage());

        }

        Exception transferException = transfer.getException();

        if (transferException != null)

        {

** System.out.println("Transfer exception occurred: " + transferException);**

** //FLOW, asked me to add this: it captures the stack frame for thread of interest**

** ExecutionException executionException = (ExecutionException) transferException.getCause();**

** if (executionException != null)**

** {**

** // this should be not null**

** Throwable causingException = executionException.getCause();**

** causingException.printStackTrace();**

            }

        }

        if (transferError != null && transferException != null)

        {

            System.out.println("File receive SUCCEEDED!");

        }

    }

    catch (SmackException se)

    {

        System.out.println("Caught SmackException in fileTransferRequest");

        ExecutionException executionException = (ExecutionException) se.getCause();

        if (executionException != null)

        {

            // this should be not null

            Throwable causingException = executionException.getCause();

            causingException.printStackTrace();

        }

    }

    catch (Exception e)

    {

        ExecutionException executionException = (ExecutionException) e.getCause();

        if (executionException != null)

        {

            // this should be not null

            Throwable causingException = executionException.getCause();

            causingException.printStackTrace();

        }

        System.out.println("Caught Exception in fileTransferRequest");

        System.out.println(e.getMessage());

    }

}

}

Not sure what version “4.1.0-rc1” denotes,

This one Maven Central Repository Search AND%20v%3A%224.1.0-rc1%22

public void AddServiceDiscoveryManagerFeatures()

public void AddIQExtensionProviders()

Why do you do this? What makes you think this is necessary?

Caused by: org.jivesoftware.smack.SmackException$NoResponseException: No response received within packet reply timeout. Timeout was 5000ms (~5s)

at org.jivesoftware.smackx.filetransfer.FaultTolerantNegotiator$NegotiatorService. call(FaultTolerantNegotiator.java:181)

This is the problem, Smack does not receive a response or is not able to understand it. It appears that the XMPP trace is from the file transfer receiver side? The other side would be interesting too.

I posted this same packet reply timeout issue back on Jan. 23rd, 2015 in a different discussion on pubsub. Please read, smack-4.1.0-beta2: Timeout on publish PayloadItem containing JSON. Only difference was that Smack client was doing pubsub instead of file transfer.

Regarding Flow’s question on IQ Providers: It is my understanding that Smack clients needs to specify the correct IQ providers in order for File Transfer to be able to parse the stanza at run-time. Furthermore, one thing I noticed is the File Transfer example included with Smack, https://www.igniterealtime.org/builds/smack/docs/latest/documentation/extensions /filetransfer.html, are missing how-to set up the ProviderManager. Same can be said for the PubSub examples. Using the ProviderManager singleton in 4.1.0-rc1, is the following addIQProvider(…) below the correct IQ Provider for File Transfer? If not, what corrections are needed to ensure successful file transfer? Specifically, for 1.) the OutgoingFileTranser (aka, sender) and 2.) the FileTransferListener, which both connect to the same XMPP server. Likewise, for the ServiceDiscoveryManager, which features does she need for successful file transfer?

    ProviderManager.addIQProvider("query", "[http://jabber.org/protocol/disco#items](http://jabber.org/protocol/disco#items)", new DiscoverItemsProvider());

    ProviderManager.addIQProvider("query", "[http://jabber.org/protocol/disco#info](http://jabber.org/protocol/disco#info)", new DiscoverInfoProvider());

    ProviderManager.addIQProvider("query", "jabber:iq:privacy", new PrivacyProvider());

    ProviderManager.addIQProvider("malformed-action", "[http://jabber.org/protocol/commands](http://jabber.org/protocol/commands)", new AdHocCommandDataProvider());

    ProviderManager.addIQProvider("si", "[http://jabber.org/protocol/si](http://jabber.org/protocol/si)", new StreamInitiationProvider());

    ProviderManager.addIQProvider(Bytestream.QUERY_ELEMENT, Bytestream.NAMESPACE, new BytestreamsProvider());

    ProviderManager.addIQProvider(Bytestream.StreamHost.ELEMENTNAME, Bytestream.NAMESPACE, new BytestreamsProvider());

    ProviderManager.addIQProvider(Bytestream.StreamHostUsed.ELEMENTNAME, Bytestream.NAMESPACE, new BytestreamsProvider());

    ProviderManager.addIQProvider("open", "[http://jabber.org/protocol/ibb](http://jabber.org/protocol/ibb)", new OpenIQProvider());

    ProviderManager.addIQProvider("data", "[http://jabber.org/protocol/ibb](http://jabber.org/protocol/ibb)", new DataPacketProvider.IQProvider());

    ProviderManager.addIQProvider("close", "[http://jabber.org/protocol/ibb](http://jabber.org/protocol/ibb)", new CloseIQProvider());

    ProviderManager.addExtensionProvider("data", "[http://jabber.org/protocol/ibb](http://jabber.org/protocol/ibb)", new DataPacketProvider.PacketExtensionProvider());

Today

  • I increased packet reply timeout to 15 seconds using setPacketReplyTimeout(15000); Still get * org.jivesoftware.smack.SmackException$NoResponseException: No response received within packet reply timeout. Timeout was 15000ms (~15s)*
  • Per request from @Flow, for Smack sender, I set SmackConfiguration.DEBUG = true. Below is this OutgoingFileTransfer’s packet trace:

OutgoingFileTransfer

Raw Sent Packets

-----------------------------

<stream:stream xmlns=‘jabber:client’ to=‘test.tester.net’ xmlns:stream=‘http://etherx.jabber.org/streams’ version=‘1.0’ from=‘test-sender@test.tester.net’ xml:lang=‘en’>

=

Y2hhcnNldD11dGYtOCx1c2VybmFtZT0iamFjZS 1kaXNjb3Zlcnktc2VuZGVyIixyZWFsbT0idGFsa2ludC5lbmVybm9jLm5ldCIsbm9uY2U9InFqMm9rQW dnNGJiM0dKYUh2dUozM0dla3RLRUkySElOa01nYzYvMEgiLG5jPTAwMDAwMDAxLGNub25jZT0iZ25jNk 1zdyt3aEE2VGQ2eVFsTUtoWmltMGxuNWdoTGhoVFE1VEJHNyIsZGlnZXN0LXVyaT0ieG1wcC90YWxraW 50LmVuZXJub2MubmV0IixtYXhidWY9NjU1MzYscmVzcG9uc2U9ZTU4ZDM2NzQ3ODM3OWQ0OTkyY2NkOD IyZDNlMWNjODgscW9wPWF1dGg=

<stream:stream xmlns=‘jabber:client’ to=‘talkint.enernoc.net’ xmlns:stream=‘http://etherx.jabber.org/streams’ version=‘1.0’ from=‘test-sender@test.tester.net’ id=‘6e163390’ xml:lang=‘en’>

Smack

Discovery file named: results.json

[http://jabber.org/protocol/bytestreams](http://jabber.org/protocol/bytestreams) [http://jabber.org/protocol/ibb](http://jabber.org/protocol/ibb)

OutgoingFileTransfer

Raw Received Packets

--------------------------------

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

<stream:stream xmlns:stream=“http://etherx.jabber.org/streams” xmlns=“jabber:client” from=“test.tester.net” id=“6e163390” xml:lang=“en” version=“1.0”>

stream:features

DIGEST-MD5

PLAIN

CRAM-MD5

zlib

</stream:features>

cmVhbG09InRhbGtpbnQuZW5lcm5vYy5uZXQiLG 5vbmNlPSJxajJva0FnZzRiYjNHSmFIdnVKMzNHZWt0S0VJMkhJTmtNZ2M2LzBIIixxb3A9ImF1dGgiLG NoYXJzZXQ9dXRmLTgsYWxnb3JpdGhtPW1kNS1zZXNz

cnNwYXV0aD1kNTU2MDE1YWI5MDRmMmY0MGVjZm YyNmYxYmRmY2Y3Ng==

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

<stream:stream xmlns:stream=“http://etherx.jabber.org/streams” xmlns=“jabber:client” from=“test.tester.net” id=“6e163390” xml:lang=“en” version=“1.0”>

stream:features

zlib

</stream:features>

test-sender@test.tester.net/Smack

http://jabber.org/protocol/bytestreams

http://jabber.org/protocol/ibb

It is my understanding that Smack clients needs to specify the correct IQ providers in order for File Transfer to be able to parse the stanza at run-time.
No it does not. What makes you think that? Why would an API want its user to need to configure existing providers? Please remove all code related to ProviderManager that does not register custom providers (i.e. ones written by you).

From your log it appears that Smack does not get an reply to the following IQ:

Now you need to investigate at the receiver of this IQ set, why it doesn’t answer.

Okay, I removed the extraneous setup of ProviderManager and setup of ServiceDiscoveryManager.

Is there a standalone main() that has a functional recieveFile(…) that works in 4.1.0-rc1? As a reminder, please understand when using PSI client to receive a file sent by 4.1.0-rc1 OutgoingFileTranser class, PSI negotiates and receives both XEP-0047 In-Band Bytestrean or XEP-0065 SOCKS5 flavors without error and without any timeout. Otherwise, if this problem is my usage of the Smack class library, then I would like to re-write *https://www.igniterealtime.org/builds/smack/docs/latest/documentation/extensions /filetransfer.html *since this is the basis for my implementation.

For now, I will keep debugging the last IQ, which crashes inside of Smack API:

IncomingFileTransfer transfer = fileTransferRequest.accept();

transfer.recieveFile(file);

while (!transfer.isDone())

{

** //Crash occurs here, inside an internal thread of control created by Smack org.jivesoftware.smack.SmackException$NoResponseException **

}

Debug Test Result

  • Debugging/single-stepping into the receiveFile creates a thread, where I have observed streamNogotiatorTask,get(…) throws an ExecutionException “Error in execution”. See below:
  • My findings correlate with adjacent discussion titled File Transfer fails on Smack 4.1.0-beta 1

Sender’s Last Raw Sent Packets

Receiver’s Last Raw Received Packets

File transfer NEGOTIATING STREAM

File transfer ERROR

Transfer exception occurred: org.jivesoftware.smack.SmackException: Error in execution

org.jivesoftware.smack.SmackException: org.jivesoftware.smack.SmackException$NoResponseException: No response received within packet reply timeout. Timeout was 15000ms (~15s)

at org.jivesoftware.smackx.filetransfer.FaultTolerantNegotiator.createIncomingStre am(FaultTolerantNegotiator.java:119)

at org.jivesoftware.smackx.filetransfer.IncomingFileTransfer$2.call(IncomingFileTr ansfer.java:186)

at org.jivesoftware.smackx.filetransfer.IncomingFileTransfer$2.call(IncomingFileTr ansfer.java:183)

at java.util.concurrent.FutureTask.run(FutureTask.java:262)

at org.jivesoftware.smackx.filetransfer.IncomingFileTransfer.negotiateStream(Incom ingFileTransfer.java:190)

at org.jivesoftware.smackx.filetransfer.IncomingFileTransfer.access$100(IncomingFi leTransfer.java:57)

at org.jivesoftware.smackx.filetransfer.IncomingFileTransfer$1.run(IncomingFileTra nsfer.java:129)

at java.lang.Thread.run(Thread.java:745)

Caused by: org.jivesoftware.smack.SmackException$NoResponseException: No response received within packet reply timeout. Timeout was 15000ms (~15s)

at org.jivesoftware.smackx.filetransfer.FaultTolerantNegotiator$NegotiatorService. call(FaultTolerantNegotiator.java:181)

at org.jivesoftware.smackx.filetransfer.FaultTolerantNegotiator$NegotiatorService. call(FaultTolerantNegotiator.java:170)

at java.util.concurrent.FutureTask.run(FutureTask.java:262)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

at java.util.concurrent.FutureTask.run(FutureTask.java:262)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

… 1 more

The Smack integration-test also fails with same error: org.jivesoftware.smack.SmackException$NoResponseException: No response received within packet reply timeout. Timeout was 5000ms (~5s)

https://github.com/igniterealtime/Smack/blob/4.1/smack-extensions/src/integratio n-test/java/org/jivesoftware/smackx/File…

As a reminder, please understand when using PSI client to receive a file sent by 4.1.0-rc1 OutgoingFileTranser class, PSI negotiates and receives both XEP-0047 In-Band Bytestrean or XEP-0065 SOCKS5 flavors without error and without any timeout.

Thread branched. For the developer discussion regarding this bug refer to Re: IncomingFileTransfer recieveFile(…) throws “error in execution”