Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

105
Vistas
Cannot create FileTransferManager object

I am trying to implement file transfer in my project but cannot create FileTransferManager object it says:

FileTransferManager (org.jivesoftware.smack.Connection) in FileTransferManager cannot be applied to (org.jivesoftware.smack.tcp.XMPPTCPConnection)

Here is my code:

 FileTransferManager manager = new FileTransferManager(connection);
            // Where connection is an object of XMPPTCPConnection

Using Smack 4.2.0 and Openfire server

over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

The problem could be the version of the smack jar. With a recent version, such as 3.2.1 it should work.

over 4 years ago · Santiago Trujillo Denunciar

0

If we are talking about the class org.jivesoftware.smackx.filetransfer.FileTransferManager it has no public constructor however it has a static factory method:

public static synchronized FileTransferManager getInstanceFor(XMPPConnection connection)

so i would try the following:

FileTransferManager manager = FileTransferManager.getInstanceFor(connection);

Are you sure that you imported a right class? Because you shouldn't be able to call its constructor at all.

over 4 years ago · Santiago Trujillo Denunciar

0

You may use getDefaultFileTransferManager to achieve it :

public static FileTransferManager getDefaultFileTransferManager(FileTransferAuth fileTransferAuth)
                                                     throws ClientException,
                                                            ServiceException

reference:official doc for Class FileTransferManager

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda