[jcifs] "A duplicate name exists on network" when a host has multiple names

Praveen Tammana praveen.public at gmail.com
Mon Oct 17 17:45:03 GMT 2005


On 10/17/05, Michael B Allen <mba2000 at ioplex.com> wrote:
>
> On Mon, 17 Oct 2005 01:32:08 -0700
> Praveen Tammana <praveen.public at gmail.com> wrote:
>
> > Hi,
> >
> > I am working with 1.2.1 and I am getting errors when working with a host
> > that has multiple names. (eg: deathstar = zpac23 =
> > 172.25.181.23 <http://172.25.181.23><http://172.25.181.23>).
> > For example, when I run the ListFiles example:
> >
> > java ListFiles smb://deathstar/ ------- works
> > java ListFiles smb://zpac23/ ------- does not
> > java ListFiles smb://172.25.181.23/ ------- works
>
> Where exactly does it fail? What's the exception?


Forgot to add the stack trace, sorry 'bout that.

Exception in thread "main" jcifs.smb.SmbException: A duplicate name exists
on the network.
at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:456)
at jcifs.smb.SmbTransport.send(SmbTransport.java:556)
at jcifs.smb.SmbSession.sessionSetup(SmbSession.java:263)
at jcifs.smb.SmbSession.send(SmbSession.java:220)
at jcifs.smb.SmbTree.treeConnect(SmbTree.java:137)
at jcifs.smb.SmbFile.connect(SmbFile.java:791)
at jcifs.smb.SmbFile.connect0(SmbFile.java:761)
at jcifs.smb.SmbFile.send(SmbFile.java:660)
at jcifs.smb.SmbFile.doNetEnum(SmbFile.java:1619)
at jcifs.smb.SmbFile.listFiles(SmbFile.java:1568)
at jcifs.smb.SmbFile.listFiles(SmbFile.java:1478)
at ListFiles.main(ListFiles.java:17)

-Praveen

>
> > Dumping the contents of InetAddress for this host reveal that
> > getHostName() = "deathstar" and
> > getCanonicalHostName() = "zpac23"
> >
> > I am afraid I don't know exactly what kind of machine this is at this
> time
> > (some Windows) but my client is running a linux 2.4.26 derivative and it
> is
> > talking to the server on port 445 - naked tcp.
> >
> > Any solution? Has anyone seen this before?
> >
> > Thanks
> > -Praveen
> >
> > P.S. I am using dnsjava <http://www.xbill.org/dnsjava/> for DNS name
> > resolution and the InetAddress retuned by it always has getHostName() =
> > getCanonicalHostName() = "zpac23" regardless of what name I use with
> > getByName(), so it never works in there. It seems to be an error on
> > dnsjava's part because, as per documentation of InetAddress.getHostName
> (),
> > "If this InetAddress was created with a host name, this host name will
> be
> > remembered and returned;...."
> >
>
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the jcifs mailing list