[jcifs] NtlmHttpFilter - Uncaught SmbException
Michael B Allen
mba2000 at ioplex.com
Sun Jun 27 03:37:03 GMT 2004
On Sat, 26 Jun 2004 06:13:30 -0400
Eric <eglass1 at comcast.net> wrote:
> If you've got jcifs.http.loadBalance=true (or unset, as it defaults to
> true), my guess would be that one of the controllers is down; that would
> account for the intermittent failures.
Yes, that's definately a possibility. Or limit the domain
controllers used to the top N in the list returned by WINS with the
jcifs.netbios.lookupRespLimit property. For details Bill should read:
http://jcifs.samba.org/src/docs/ntlmhttpauth.html#props
> You could try the below; I think
> this would enumerate the domain controllers and obtain challenges from
> all of them (I say think because I haven't tested this):
This will only work if you set jcifs.netbios.cachePolicy = 0 in
which case a different domain controller to be returned with each call
to getByName [1].
Mike
[1] although it will also make other operations quite slow as
WINS will be queried every time so I don't recommend using this setting
for other ordinary apps.
> public static void main(String[] args) throws Exception {
> char[] hex = "0123456789abcdef".toCharArray();
> String domain = args[0];
> Properties servers = new Properties();
> for (int i = 0; i < 100; i++) {
> UniAddress dc = new UniAddress(
> NbtAddress.getByName(domain, 0x1c, null));
> try {
> byte[] challenge = SmbSession.getChallenge(dc);
> char[] hexChallenge = new char[16];
> for (int j = 0, k = 0; j < 8; j++) {
> hexChallenge[k++] = hex[(challenge[j] >> 4) & 0x0f];
> hexChallenge[k++] = hex[challenge[j] & 0x0f];
> }
> servers.setProperty(dc.toString(),
> new String(hexChallenge));
> } catch (Exception ex) {
> System.out.println("Unable to contact " + dc);
> ex.printStackTrace();
> }
> }
> servers.list(System.out);
> }
--
Greedo shoots first? Not in my Star Wars.
More information about the jcifs
mailing list