[jcifs] RapException

Eric Glass eric.glass at gmail.com
Tue Aug 3 16:29:30 GMT 2004


> > I think I see the issue; I should have picked up on this earlier.  The
> > domain name in the netServerEnum call needs to be a NetBIOS style
> > name.  From your trace, you appear to be using a DNS style (e.g.
> > "my.domain.com").  While this could be used to make the connection to
> > the domain controller (as jCIFS can resolve names via DNS) the actual
> > NetServerEnum RAP call only takes NetBIOS names (e.g. "MYDOMAIN").
> 
> Hm... but that's what I did use in the first place.
> 
> Just using "MYDOMAIN" gives me an UnknownHostException as well
> as using "MYDOMAIN-MGSFT-TEST" (not sure if there is such
> a fully qualified name in the NetBIOS world at all. But I've
> seen such syntax before)
> 
> Only using "MYDOMAIN.MGSFT.TEST" seems to connect to the machine.
> 

You should be able to connect via the DNS name (as you were doing
previously); you just need to ask the server for the members of the
NetBIOS domain (rather than the DNS).  This would look something like:

    // connect to the server using the DNS domain name
    ServerManagement mgmt =
            new ServerManagement("mydomain.mgsft.test", auth);

    // ask it for the members of the "MYDOMAIN" NetBIOS domain
    ServerInfo[] info = mgmt.netServerEnum(1, ServerConstants.SV_TYPE_ALL,
            "MYDOMAIN");

If you aren't able to connect directly using "MYDOMAIN", the above
should work (since your previous trace was able to connect to
"mydomain.mgsft.test").


Eric


More information about the jcifs mailing list