Sunday, November 8, 2009

jCIFS TransportException: Invalid payload size: 254

I was looking into jCIFS for adding shared network folder support for Folder2Feed. I had a snippet of code that I had tried out quite some time back which simply listed all shared folders on a particular machine and this had worked for my PC and for the Mac. However, when I tried to run this demo code against the Mac after a few weeks with a new release, I got the following exception:

jcifs.util.transport.TransportException
java.io.IOException: Invalid payload size: 254

I didn't really investigate this because of other commitments. But a friend of mine who was also checking it out finally figured out the problem. With the earlier releases, the property jcifs.smb.client.useExtendedSecurity defaulted to false. But with the newer releases, it defaults to true. Explicitly setting it to false fixes the problem.