[jcifs] Unmapped NetServerEnum2Response code

Michael B Allen ioplex at gmail.com
Thu Mar 11 15:36:38 MST 2010

On Thu, Mar 11, 2010 at 4:40 PM, Del Merritt <del at alum.mit.edu> wrote:
> I'm using JCIFS 1.3.14*.  I have code that does this:
> public class NetServerEnum2Ext extends SmbFile
> {
>   myMethod() {
>     int Flags = 0x00000200;
>     NetServerEnum2 req = new NetServerEnum2(host, Flags);
>     NetServerEnum2Response resp = new NetServerEnum2Response();
>     send(req, resp);
>     // Check status
>     if(resp.status != SmbException.ERROR_SUCCESS && resp.status !=
> SmbException.ERROR_MORE_DATA)
>                     throw new SmbException(resp.status, true);
>   ...
>   }
> }
> Usually it works fine.  Sometimes it will throw because it doesn't recognize
> the response status.  The value I see in the response status is "2".  The
> same host, flags, and authentication info (not shown for brevity) are used
> both when it works and when it doesn't.
> jcifs.smb.SmbException is not figuring out a text translation.  Where should
> I look to see what the status means?

Hi Del,

I don't even know where to begin to decipher what you're doing here.
The "2" could be a status code or it could be garbage.

Note that the Net* calls are RAP calls which are totally obsolete and
will not work in most environments. In fact, that is probably the
problem you're having. I think this particular RAP call would only
work with a NetBIOS "master browser". There is a special lookup for
that (see the NbtAddress class) but again, not all environments will
have a master browser and if they do it's not going to have a good
consistent list of servers. Getting a proper list of servers on the
subnet is a rather difficult think to do actually.


Michael B Allen
Java Active Directory Integration

More information about the jCIFS mailing list