[jcifs] IOException at ssn139, access print server

Michael B Allen ioplex at gmail.com
Mon Feb 25 10:08:09 MST 2013


Hi Naveen,

When you post a stack trace, it is important to post the full stack
trace and in particular the last "caused by" exception because that
will tell you what the root cause of the problem is. In this case it
is almost certainly a basic network connectivity failure.

Mike

On Fri, Feb 8, 2013 at 10:09 PM, Naveen <naveenmah at gmail.com> wrote:
> Hello,
> I have got a printer server Dlink DPR-2000 on my N/W and I am trying to get
> SMB shared printers from that using JCIFS in Android App.
> In Windows Explorer when I type it's ip address it shows me 4 shared
> printers.
>
> But when I am using JCIFS on my andorid app, it gives me following
> exception. Tried with teh lastest version of JCIFS.
>
> jcifs.util.transport.TransportException
> java.io.IOException: Failed to establish session with
> 0.0.0.0<00>/192.168.0.110
> at jcifs.smb.SmbTransport.ssn139(SmbTransport.java:284)
> at jcifs.smb.SmbTransport.negotiate(SmbTransport.java:294)
> at jcifs.smb.SmbTransport.doConnect(SmbTransport.java:367)
> at jcifs.util.transport.Transport.run(Transport.java:241)
> at java.lang.Thread.run(Thread.java:856)
> at jcifs.util.transport.Transport.run(Transport.java:258)
> at java.lang.Thread.run(Thread.java:856)
> at jcifs.smb.SmbTransport.connect(SmbTransport.java:354)
> at jcifs.smb.SmbTree.treeConnect(SmbTree.java:159)
> at jcifs.smb.SmbFile.doConnect(SmbFile.java:925)
> at jcifs.smb.SmbFile.doShareEnum(SmbFile.java:1877)
> at jcifs.smb.SmbFile.doEnum(SmbFile.java:1822)
> at jcifs.smb.SmbFile.listFiles(SmbFile.java:1801)
> at jcifs.smb.SmbFile.listFiles(SmbFile.java:1734)
>
>
> follwing is my code
> //              jcifs.Config.setProperty("jcifs.netbios.hostname", "AndroidPhone");
>                 SmbFile file;
>                         try {
>                                 file = new SmbFile("smb://" + "192.168.0.110", new
> NtlmPasswordAuthentication(null,null, null));
>                         String path = null;
>                     SmbFile[] files = file.listFiles();
>                     for( int i = 0; i < files.length; i++ ) {
>                         if (files[i].getType()==SmbFile.TYPE_PRINTER)
>                         {
>                                 System.out.print( " " + files[i].getName() );
>                         }
>                     }
>                         } catch (MalformedURLException e) {
>                                 // TODO Auto-generated catch block
>                                 e.printStackTrace();
>                         } catch (SmbException e) {
>                                 // TODO Auto-generated catch block
>                                 e.printStackTrace();
>                         }
>        }
>
> When I see properties of the shared printer I got in windows explorer it
> shows
> Computer Name:192.168.0.110
> Computer Type: Lanman 2.1 workstation
> Workgroup: WORKGROUP
>
> Any help or pointers will be highly appreciated..
>
> Thanks
>
>
>
>
> --
> View this message in context: http://samba.2283325.n4.nabble.com/IOException-at-ssn139-access-print-server-tp4643959.html
> Sent from the Samba - jcifs mailing list archive at Nabble.com.



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


More information about the jCIFS mailing list