powered by Jive Software

Smack 4.4.3 - Sending file via OutgoingFileTransfer.sendFile() throws IllegalArgumentException: Not supported: indent-number

Encountered the following Exception when trying to sendFile in android aTalk. Not sure why this happen.

2021-08-16 10:15:22.282 13850-22517/org.atalk.android I/aTalk: [164566] org.jivesoftware.smack.util.XmlUtil.<clinit>() XML TransformerFactory does not support indent-number attribute
    java.lang.IllegalArgumentException: Not supported: indent-number
        at org.apache.xalan.processor.TransformerFactoryImpl.setAttribute(TransformerFactoryImpl.java:580)
        at org.jivesoftware.smack.util.XmlUtil.<clinit>(XmlUtil.java:39)
        at org.jivesoftware.smack.util.XmlUtil.isClarkNotation(XmlUtil.java:69)
        at org.jivesoftware.smackx.formtypes.FormFieldRegistry.register(FormFieldRegistry.java:75)
        at org.jivesoftware.smackx.formtypes.FormFieldRegistry.register(FormFieldRegistry.java:66)
        at org.jivesoftware.smackx.xdata.packet.DataForm.<init>(DataForm.java:112)
        at org.jivesoftware.smackx.xdata.packet.DataForm.<init>(DataForm.java:54)
        at org.jivesoftware.smackx.xdata.packet.DataForm$Builder.build(DataForm.java:561)
        at org.jivesoftware.smackx.filetransfer.FileTransferNegotiator.createDefaultInitiationForm(FileTransferNegotiator.java:375)
        at org.jivesoftware.smackx.filetransfer.FileTransferNegotiator.negotiateOutgoingTransfer(FileTransferNegotiator.java:315)
        at org.jivesoftware.smackx.filetransfer.OutgoingFileTransfer.negotiateStream(OutgoingFileTransfer.java:372)
        at org.jivesoftware.smackx.filetransfer.OutgoingFileTransfer.access$100(OutgoingFileTransfer.java:44)
        at org.jivesoftware.smackx.filetransfer.OutgoingFileTransfer$2.run(OutgoingFileTransfer.java:232)
        at java.lang.Thread.run(Thread.java:923)
2021-08-16 10:15:22.325 13850-18402/org.atalk.android D/SMACK: SENT (0): 
    <iq to='peacock@atalk.sytes.net/atalk' id='141XK-47' type='set'>
      <si xmlns='http://jabber.org/protocol/si' id='jsi_1646557298' mime-type='image/jpeg' profile='http://jabber.org/protocol/si/profile/file-transfer'>
        <file xmlns="http://jabber.org/protocol/si/profile/file-transfer" name="downports.jpg" size="27446" >
          <desc>
            Sending file
          </desc>
        </file>
        <feature xmlns="http://jabber.org/protocol/feature-neg">
          <x xmlns='jabber:x:data' type='form'>
            <field var='stream-method' type='list-single'>
              <option>
                <value>
                  http://jabber.org/protocol/bytestreams
                </value>
              </option>
              <option>
                <value>
                  http://jabber.org/protocol/ibb
                </value>
              </option>
            </field>
          </x>
        </feature>
      </si>
    </iq>

That’s a non-fatal exception, which is also denoted by the log level of Info (see the I/ in the log string) that is logged once upon initialization of Smack’s XmlUtil class. See

As you see from the stack trace, this class is initialized because FormFieldRegistry calls XmlUtil.isClarkNotation().

Thanks for clarification. Will just ignore the Exception in aTalk.