[Smack]: FileTransfer stops in negotiating

Hi,

I would like to ask you for help. In my bachelor thesis I am using smack together with OpenFire. I need to accept any incoming file and store it in dir xml/. But only thing what happen is, that client start negotiating transfer, after that stream and after that fails. on the other side I am using pidgin to send files and pidgin say, that he is waiting for transfer beginning.

Here I enclose another information:

Version of Smack: 4.0.7

I enclosed debug incoming and outcoming packets in log

Here is output of my code:

Žádost o transfer (transfer request)

Jméno souboru: sada2příklad4.pdf (name of file)

posílání dat (sending data)

Initial

0.0

Negotiating Transfer

0.0

Negotiating Stream

0.0

Negotiating Stream

0.0

Negotiating Stream

0.0

Negotiating Stream

0.0

Negotiating Stream

0.0

Přenos zkončil (transfer ended)

Here is my handleFile function

private void handleFile(){

final FileTransferManager manager = new FileTransferManager(connection);

FileTransferNegotiator.setServiceEnabled(connection, true);

manager.addFileTransferListener(new FileTransferListener() {

@Override

public void fileTransferRequest(FileTransferRequest request) {

if(request != null){

try {

System.out.println(“Žádost o transfer”);

final IncomingFileTransfer transfer = request.accept();

System.out.println("Jméno souboru: " + request.getFileName());

String path = “./xml/”+ request.getFileName();

System.out.println("Výsledná cesta k souboru: " + path);

transfer.recieveFile(new File(path));

System.out.println(“posílání dat”);

System.out.println(transfer.getStatus());

System.out.println(transfer.getProgress());

Thread thread = new Thread(){

@Override

public void run(){

while(!transfer.isDone()) {

try {

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

System.out.println("ERROR!!! " + transfer.getError());

} else {

System.out.println(transfer.getStatus());

System.out.println(transfer.getProgress());

}

sleep(1000);

} catch (InterruptedException ex) {

Logger.getLogger(AdminAgent.class.getName()).log(Level.SEVERE, null, ex);

}

}

System.out.println(“Přenos zkončil”);

}

};

thread.start();

} catch (SmackException ex) {

Logger.getLogger(AdminAgent.class.getName()).log(Level.SEVERE, null, ex);

}

}

}

});

System.out.println(“Inicializovaný chat”);

}

I really don’t know how to make it work and I would really appreciate any help.

Best regards

Jakub Peschel
log.zip (1741 Bytes)

Please follow the instructions found at https://github.com/igniterealtime/Smack/wiki/How-to-ask-for-help-or-report-an-is sue when asking for help. Thank you.

I am sorry I thought that everything is included as its written there. Could you explain me, what is missing to help me add it? Problem is, that code doesn’t throw any error or exception, so I cant include it.

Thank you a lot.

Jakub Peschel