Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8232511

The redirected default printer not return on Citrix Xendekstop and RDP Session

    Details

      Description

      ADDITIONAL SYSTEM INFORMATION :
      Platform:
      Windows 10 LTSC 2019 and Windows Server 2016/2019

      Architecture:
      x64

      Any Java Runtime

      A DESCRIPTION OF THE PROBLEM :
      Hi support,
      the problem occurs in Citrix or RDP session when you set a default printer redirected.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Logon to session Citrix or RDP
      2. set a local or network default printer (Microsoft Print to PDF)
      3. run the code "PrintServiceLookupTest".
      4. set a redirected default printer (Invia a OneNote 16 (from WKST015))
      5. run the code "PrintServiceLookupTest".


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Print Service Default Name is (Invia a OneNote 16 (from WKST015))
      ACTUAL -
      Print Service Default Name is (Microsoft Print to PDF)

      ---------- BEGIN SOURCE ----------
      public class PrintServiceLookupTest {
             public static void main(String[] args) {
                   javax.print.PrintService service = javax.print.PrintServiceLookup.lookupDefaultPrintService();
                   if (service != null) {
                          String printServiceName = service.getName();
                          System.out.println("Stampante di default (" + printServiceName+")");
                   } else {
                          System.out.println("Nessuna stampante di default trovata");
                   }
             }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      The registry key used for local or network printers is:

      HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device

      The registry key used for redirect printers is:

      HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\SessionDefaultDevices\ "session" \Device

      In these links you can find workarounds, but only until you change your default printer

      https://social.msdn.microsoft.com/Forums/en-US/59199e98-4db0-4a73-90ef-52ba8f072153/default-printer-registry-key-not-set-correctly-on-windows-server-20162019?forum=servervirtualization

      https://social.technet.microsoft.com/Forums/ie/en-US/a56e481e-6bd5-44dc-8873-d2c58e7e1948/bug-hkcu-default-printer-registry-key-isnt-set-properly-in-windows-server-2016?forum=ws2016

      https://discussions.citrix.com/topic/396513-windows-server-2016-and-xenapp-715-cu2-default-printer-registry-key-not-set-when-launching-published-app/

      My case to AdoptOpenJDK
      https://github.com/AdoptOpenJDK/openjdk-build/issues/1277

      FREQUENCY : always


        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                psadhukhan Prasanta Sadhukhan
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: