[jcifs] problem with ant run

Eric Glass eric.glass at gmail.com
Fri Aug 13 17:24:56 GMT 2004


Installing the HTTP URL handler requires that jCIFS be installed in
the system classloader.  It's likely that Ant is adding the specified
classpath items to a child classloader before invoking the class.

You can wrap a "normal" HttpURLConnection with the handler without
installing it, which will bypass this requirement; in your code, you
would just have to do:

    URL url = new URL("http://server/stuff");
    HttpURLConnection connection =
            (HttpURLConnection) url.openConnection();
    // add NTLM support
    connection = new NtlmHttpURLConnection(connection);


Eric


On Fri, 13 Aug 2004 12:24:30 -0400, Steele, Ryan K
<ryan.k.steele at saic.com> wrote:
> When I run my code command line it works fine
> java -classpath
> ..\dataload\jobsys\config\;D:\currentwork\jobsys\dataload\jobsys\bin\jar\jobs
> ys.jar;D:\currentwork\jobsys\dataload\jobsys\bin\jar\jcifs.jar;
> org.nlac.data.job.controller.NLAC_Job_Controller
> 
> When I run the code through ant I get no errors but I get (Server returned
> HTTP response code: 401 ) message
> 
> ant code
> <target name="run" >
>      <!-- run the class -->
>      <java classname="${run.class}">
>        <classpath>
>           <pathelement path=".\dataload\jobsys\config"/>
>           <pathelement
> location="D:\currentwork\jobsys\dataload\jobsys\bin\jar\jobsys.jar"/>
>           <pathelement
> location="D:\currentwork\jobsys\dataload\jobsys\bin\jar\jcifs.jar"/>
>         </classpath>
>      </java>
>   </target>
> 
> Any help would be greatly appreciated
>


More information about the jcifs mailing list