[jcifs] how to use preauthentication to get around "Access is denied" error?

Brian Lee leeb_08 at yahoo.com
Fri Sep 10 12:59:51 MDT 2010


Mike,

I went ahead and set the system property using System.setProperty() in my dev 
environment but now I'm seeing the "Access is denied" issue there now.  I guess 
it's kind of a good thing in that I can replicate the issue now... :-P  Maybe it 
was always there but I never noticed before?

In any case, here's the stack trace...

jcifs.smb.SmbTransport.checkStatus  (SmbTransport.java:528)
jcifs.smb.SmbTransport.send(SmbTransport.java:645)
jcifs.smb.SmbSession.sessionSetup(SmbSession.java:395)
jcifs.smb.SmbSession.send(SmbSession.java:224)
jcifs.smb.SmbTree.treeConnect(SmbTree.java:176)
jcifs.smb.SmbFile.doConnect(SmbFile.java:906)
jcifs.smb.SmbFile.connect(SmbFile.java:949)
jcifs.smb.SmbFile.connect0(SmbFile.java:875)
jcifs.smb.SmbFile.getType(SmbFile.java:1275)
jcifs.smb.SmbFile.doEnum(SmbFile.java:1726)
jcifs.smb.SmbFile.listFiles(SmbFile.java:1708)
jcifs.smb.SmbFile.listFiles(SmbFile.java:1641)
com.mycompany.SmbConnection.getListing(SmbConnection.java:437)

Any other ideas on this?  Thanks.

Brian




________________________________
From: Michael B Allen  <ioplex at gmail.com>
To: Brian Lee <leeb_08 at yahoo.com>
Cc: jcifs at lists.samba.org
Sent: Thu, September 2, 2010 9:43:02 PM
Subject: Re: [jcifs] how to use preauthentication to get around "Access is 
denied" error?

Hi Brian,

Try disabling DFS with the property:

  jcifs.smb.client.dfs.disabled = true

DFS was added after 1.1 and is the sort of thing that might cause a
sporadic error if the client only has access rights for some DFS nodes
but not all.

Mike

On Thu, Sep 2, 2010 at 9:07 AM, Brian Lee <leeb_08 at yahoo.com> wrote:
> Hi Mike,
>
> OK thanks for the clarification.
>
> In that case, what would cause an "Access is denied" error when the
> listFiles() method is called?  I am instantiating the SmbFile object with
> the constructor that takes in a NtlmPasswordAuthentication object.  The
> version that is giving us issues is 1.3.14.  When we revert to an older
> version (1.1), the error goes away.  The issue isn't a bad
> username/password; the operation works 95%  of the time.  It's the 30 minute
> to 1 hour down time where the "Access is denied" error manifests that we
> have every day that's causing us grief.
>
> I wish I could send you the stack trace but we have limited access to the
> deployment environment and we can't replicate the issue in our dev
> environment.  Again, it's only on the one server that we're using multiple
> accounts to log in.  We don't have this issue in our dev environment where
> we're doing the same thing.
>
> Thanks again for your help.
>
> Brian
>
> ________________________________
> From: Michael B Allen <ioplex at gmail.com>
> To: Brian Lee <leeb_08 at yahoo.com>
> Cc: jcifs at lists.samba.org
> Sent: Thu, September 2, 2010 2:38:09 AM
> Subject: Re: [jcifs] how to use preauthentication to get around "Access is
> denied" error?
>
> Hi Brian,
>
> The "preauthentication" business was from the HTTP filter which is no
> longer used. If you're trying to do CIFS operations, just create an
> NtlmPasswordAuthentication object and then use that with various
> SmbFile* constructors.
>
> Mike
>
> On Wed, Sep 1, 2010 at 11:59 AM, Brian Lee <leeb_08 at yahoo.com> wrote:
>> Hi,
>>
>> I've got an application that gets file listings on shared Windows folders
>> using JCIFS.  However, there is one particular server that is giving us
>> grief.  It works 95% of the time but every so often,  it'll start giving
>> "Access is denied" messages for long stretches at a time (half hour plus).
>> But then miraculously, the error will clear and things will be working
>> smoothly again.
>>
>> I figured that the issue was due to the Windows Server 2003 domain
>> controller issue.  We're attempting to authenticate several different
>> users
>> near simultaneously (the jobs are working from a timer); from my online
>> research it appears that the solution is using preauthentication.
>> However,
>> when I try to find out HOW to do preauthentication, the docs are pretty
>> sparse.
>>
>> What I tried is creating an instance of the NtlmPasswordAuthentication,
>> passing in the user credentials and using the SmbFile constructor that
>> takes
>> that in as a parameter.  Unfortunately, we're still  seeing the same error
>> message pop up when I make the call to SmbFile.listFiles() so I must be
>> doing it wrong.
>>
>> Could somebody either explain to me the proper way of doing
>> preauthentication or refer me to an example out there?  Or is the error
>> message a symptom of a completely different problem?  Thanks!
>>
>> Brian
>>
>>
>
>
>
> --
> Michael B Allen
> Java Active Directory Integration
> http://www.ioplex.com/
>
>



-- 
Michael B Allen
Java Active Directory Integration
http://www.ioplex.com/



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/jcifs/attachments/20100910/dffe52e8/attachment.html>


More information about the jCIFS mailing list