Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-4478

Because local PrintService objects on Windows have a name which is not their UNC path, the PrinterProducer can never find them.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.8.1
    • 2.7.4, 2.8.2, 2.9.0
    • camel-printer
    • None
    • Windows 7 64-bit, jdk 1.6.0_20

    • Novice

    Description

      In org.apache.camel.component.printer.PrinterProducer, the line:

      setPrinter("\\\\" + config.getHostname() + "
      " + config.getPrintername());

      reconstructs a UNC path which is expected to match the name of a PrintService on the system. For local printers on Windows, the name of the PrintService is simply the name of the printer without the host and any backslashes, so the PrinterProducer is never able to find them.

      So when config.getHostname() is "localhost", at least on Windows, the line should be simply:

      setPrinter(config.getPrintername())

      so that we'd have code like:

      if ("localhost".equalsIgnoreCase(config.getHostname())) {
      setPrinter(config.getPrintername());
      } else {
      setPrinter("\\\\" + config.getHostname() + "
      " + config.getPrintername());
      }

      This can only work if issue CAMEL-4477 about the error in parseURI() in PrinterConfiguration is also fixed.

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            denis@denisrobert.net Denis Robert
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: