Issue

Configuring sendToPrinter to use CIFS as a Printer Protocol sometimes results in slow print performance, and the request can even timeout:

[Transport1] ERROR [STDERR] - java.net.ConnectException: Connection timed out
[Transport1] ERROR [STDERR] - at java.net.PlainSocketImpl.socketConnect(Native Method)
[Transport1] ERROR [STDERR] - at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
[Transport1] ERROR [STDERR] - at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
[Transport1] ERROR [STDERR] - at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
[Transport1] ERROR [STDERR] - at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
[Transport1] ERROR [STDERR] - at java.net.Socket.connect(Socket.java:579)
[Transport1] ERROR [STDERR] - at java.net.Socket.connect(Socket.java:528)
[Transport1] ERROR [STDERR] - at java.net.Socket.(Socket.java:425)
[Transport1] ERROR [STDERR] - at java.net.Socket.(Socket.java:208)
[Transport1] ERROR [STDERR] - at jcifs.smb.SmbTransport.negotiate(SmbTransport.java:293)
[Transport1] ERROR [STDERR] - at jcifs.smb.SmbTransport.doConnect(SmbTransport.java:353)
[Transport1] ERROR [STDERR] - at jcifs.util.transport.Transport.run(Transport.java:240)
[Transport1] ERROR [STDERR] - at java.lang.Thread.run(Thread.java:745)

Solution

To investigate the problem, the first step is to enable trace level logging on JCIFS:

  • Increase the Log Level on JCIFS by adding the “-Djcifs.util.loglevel=10“ JVM argument.
  • Enable TRACE Log Level on the component “com.adobe.printSubmitter.output.CIFSPrintJob”.

This allows us to obtain a more detailed Stack Trace showing exactely what operation is timing out:

jcifs.util.transport.TransportException: Connection timeout
at jcifs.util.transport.Transport.connect(Transport.java:178)
at jcifs.smb.SmbTransport.connect(SmbTransport.java:338)
at jcifs.smb.SmbTree.treeConnect(SmbTree.java:144)
at jcifs.smb.SmbTree.send(SmbTree.java:66)
at jcifs.smb.SmbTransport.getDfsReferrals(SmbTransport.java:742)
at jcifs.smb.Dfs.getTrustedDomains(Dfs.java:64)
at jcifs.smb.Dfs.resolve(Dfs.java:146)

As per the above Stack Trace, DFS resolution is timing out: This query is used to check if the printer actually exists on some other server in which case request is routed to that other server. The timeout indicates an issue with the Domain Controller which is either unresponsive, or too slow to respond. Passing the JVM argument "-Djcifs.smb.client.dfs.disabled=true" resolves the issue above.

In case the situation is not related to DFS resolution, indepth analysis of Stack Traces from the detailed log should indicate which JCIFS property is adequate to resolve the problem. 

For all properties available on JCIFS, please refer to this link.