powered by Jive Software

SMACK in XEP-363 file upload throws "no protocol" exception

android

#1

Hi,

I’m trying to use SMACK for http file upload against ejabberd:

           HttpFileUploadManager manager = HttpFileUploadManager.getInstanceFor(connection);

            Slot slot = manager.requestSlot("test1.jpg", 10000);

returned stanza:

<iq xml:lang='en' to='bob@xxx.yyy.org/mobile' from='upload.xxx.yyy.org' type='result' id='HLvqO-26'><slot xmlns='urn:xmpp:http:upload:0'><get url='https://xxx.yyy.org:5444/upload/2dfea790d3d7eb3c7fee39c7b648e23fc984410b/MuSjWQLqSVMLhzSynw0x4NImKxJvKipvuVR3s3eI/test1.jpg'/><put url='https://xxx.yyy.org:5444/upload/2dfea790d3d7eb3c7fee39c7b648e23fc984410b/MuSjWQLqSVMLhzSynw0x4NImKxJvKipvuVR3s3eI/test1.jpg'/></slot></iq>

But SMACK throws:

Connection XMPPTCPConnection[bob@xxx.yyy.org/mobile] (0) closed with error
                                                                              java.net.MalformedURLException: no protocol: 
                                                                                  at java.net.URL.<init>(URL.java:589)
                                                                                  at java.net.URL.<init>(URL.java:486)
                                                                                  at java.net.URL.<init>(URL.java:435)
                                                                                  at org.jivesoftware.smackx.httpfileupload.provider.SlotProvider.parse(SlotProvider.java:60)
                                                                                  at org.jivesoftware.smackx.httpfileupload.provider.SlotProvider.parse(SlotProvider.java:40)
                                                                                  at org.jivesoftware.smack.provider.Provider.parse(Provider.java:32)
                                                                                  at org.jivesoftware.smack.util.PacketParserUtils.parseIQ(PacketParserUtils.java:633)
                                                                                  at org.jivesoftware.smack.util.PacketParserUtils.parseStanza(PacketParserUtils.java:153)
                                                                                  at org.jivesoftware.smack.AbstractXMPPConnection.parseAndProcessStanza(AbstractXMPPConnection.java:1049)
                                                                                  at org.jivesoftware.smack.tcp.XMPPTCPConnection.access$500(XMPPTCPConnection.java:151)
                                                                                  at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1040)
                                                                                  at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPConnection.java:994)
                                                                                  at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:1010)
                                                                                  at java.lang.Thread.run(Thread.java:761)

Any ideas ?

SMACK version: 4.2.2
ejabberd : 17.12.

Thanks,


How to use Gradle to reference a SMACK snapshot build
#2

Looks like you run into SMACK-790.


#3

Thanks for your reply !

Any workarounds ? We must have the ability to send files in our app (without both parties online of course)

Or any estimation on when this will be fixed (it’s very critical to us) ?

Thanks again,


#4

You can always use a nightly unique snapshot build from igniterealtime.org/repo which includes the fix.


#5

thanks ! can I also use the binaries at https://www.igniterealtime.org/downloads/nightly_smack.jsp ?

From which date is the fix included ?