[jcifs] Re: jcifs-0.9.4 released (fwd)

Eric Glass eric.glass at gmail.com
Thu Jul 1 14:49:08 GMT 2004

> We're using Borland JBuilder as IDE and out of it my applet runs just fine with
> NTLM. I just made a new release of our software, signed the applet jar, ran it
> and got this:
> Server returned HTTP response code: 401 for URL: http://192.168.0.
> 44/rpc-server/pv-pbone.php
> Any ideas?

It sounds as though the URL handler isn't getting installed properly;
I'm not terribly familiar with the details of signed applet
development.  You could try inserting some printlns in the
NtlmHttpURLConnection class to verify that it is or isn't installed. 
Typically, you'd see this error from the default URL handler (which
sees the request for NTLM authentication and just passes it on since
it doesn't know how to deal with it).

I believe that to install a custom URL handler, it has to be under the
system classloader (i.e., in CLASSPATH); if the jCIFS jar is being
loaded from the website, this might cause issues.  You could try
putting the jCIFS jar in the client box's jre/lib/ext directory (or
otherwise add it to the classpath) and then visit the site and see if
that works.  Although I'm guessing your use case would prohibit that
in your production rollout (i.e., you don't really want to physically
load the jar on all the client boxes).

Your best option might be to modify XML-RPC to manually use an
NtlmHttpURLConnection.  This shouldn't be terribly difficult (although
I haven't tried).  In XmlRpcClient, where it opens the connection, you
would just change it to:

    URLConnection con = url.openConnection();
    con = new NtlmHttpURLConnection(con);

This is basically what our URL handler does.  Since you aren't
changing the default URL handler in this case, there shouldn't be any
issues with the classpath etc.


More information about the jcifs mailing list