[jcifs] jcifs.smb.SmbException: Unsupported trying to list samba shares of Linux Box

Michael B Allen ioplex at gmail.com
Sun Nov 16 18:03:39 GMT 2008


On Sun, Nov 16, 2008 at 7:42 AM, rosso <fivefinger at gmx.net> wrote:
> Cheers Mike.
>
> So,
> with those two options the output is exactly as before.
> Well, i'm quite new to java and i'm not into SMB too much, so what exactly
> looks odd to you, maybe i dont see something thats supposed to be obvious?

You don't need to use the URL class.

Just try the examples/ListFiles.java example.

Does that yield the same "unsupported" SmbException?

Mike

> As far as i got it from the API i can call the SmbFile constructor with a URL
> of a SMB-Server as single argument and can call the list() method  on it to
> get an array of Strings that describe the shares on the Server.
> And as i mentioned the same code with just a different ServerURL pointing to a
> Windows box works exactly like it is supposed to.
> That's what is confusing me most.
>
> rosso
>
> Am Freitag 14 November 2008 21:45:40 schrieb Michael B Allen:
>> If you set jcifs.lmCompatibility = 0 and
>> jcifs.smb.client.useExtendedSecurity = false does it work?
>>
>> If not it could be that you're using JCIFS in some way that is
>> provoking different  behavior. Your sample code is somewhat odd. Do
>> any of the examples generate the same behavior?
>>
>> Mike
>>
>> On Fri, Nov 14, 2008 at 6:37 AM, rosso <fivefinger at gmx.net> wrote:
>> > Hello people!
>> >
>> > Im about to write a small app to do incremental backups of samba shares
>> > in a local network.
>> > While playing around with the jcifs module (1.3.0) i experienced problems
>> > browsing a share on a linux box running smbd 3.2.3
>> > While this test Code works fine for a Winbox on the same network it fails
>> > on the linux box.
>> >
>> > smb://diskordia/ found                         #note: smb.exists()
>> > jcifs.smb.SmbException: Unsupported            #note: smb.list()
>> >        at
>> > jcifs.smb.SmbComSessionSetupAndX.<init>(SmbComSessionSetupAndX.java:82)
>> > at jcifs.smb.SmbSession.sessionSetup(SmbSession.java:282) at
>> > jcifs.smb.SmbSession.send(SmbSession.java:234)
>> >        at jcifs.smb.SmbTree.treeConnect(SmbTree.java:161)
>> >        at jcifs.smb.SmbFile.doConnect(SmbFile.java:850)
>> >        at jcifs.smb.SmbFile.doShareEnum(SmbFile.java:1725)
>> >        at jcifs.smb.SmbFile.doEnum(SmbFile.java:1673)
>> >        at jcifs.smb.SmbFile.list(SmbFile.java:1646)
>> >        at jcifs.smb.SmbFile.list(SmbFile.java:1543)
>> >        at HornySync.main(HornySync.java:20)
>> >
>> > Is this some incompatibility?
>> > I also tried to set up the environment properly by configuring the linux
>> > box as WINS Server and setting jcifs.netbios.wins to the corresponding
>> > ip. Funny is that smb.exists() works for just the server
>> > (smb://diskordia/), but reports "unsupported" for the share
>> > (smb://diskordia/data/).
>> >
>> > Here's my Testcode:
>> >
>> > import jcifs.smb.*;
>> > import java.net.URL;
>> >
>> > public class HornySync {
>> >    public static void main (String[] args) {
>> >        URL path = null;
>> >        SmbFile smb = null;
>> >        jcifs.Config.registerSmbURLHandler();
>> >        try {path = new URL("smb://diskordia/");}
>> >        catch (Exception e) {e.printStackTrace( System.out);}
>> >        try {smb = new SmbFile(path);}
>> >        catch (Exception e) {e.printStackTrace( System.out);}
>> >        try {if (smb.exists()) {System.out.println(smb+" found");}}
>> >        catch (SmbException e) {e.printStackTrace( System.out);}
>> >        String [] files = new String[600];
>> >        try {
>> >            files = smb.list();
>> >            for (String file : files) {
>> >                System.out.println(file);
>> >            }
>> >        }
>> >        catch (SmbException e) {e.printStackTrace( System.out);}
>> >    }
>> > }
>> >
>> >
>> > Any help is appreciated.
>> >
>> > Cheeers
>> >
>> >
>> > rosso
>
>



-- 
Michael B Allen
PHP Active Directory SPNEGO SSO
http://www.ioplex.com/


More information about the jcifs mailing list