JDK-8034239 : PrintServiceLookup.lookupPrintServices() returns different amount of services in comparison with lpstat -v
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 7u55,8,8u5,8u51
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-02-11
  • Updated: 2017-08-17
  • Resolved: 2016-03-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b114Fixed
Related Reports
Duplicate :  
Duplicate :  
Description
PrintServiceLookup.lookupPrintServices() returns different amount of services in comparison with lpstat -v

tta_printer is not listed on machines I run 2D_Printing/PrintServiceLookup_2D.

Testsuite name: 2d
Product(s) tested:JDK
OS/architecture: Linux

Error log file: http://scaaa008.us.oracle.com:9502/runs%2F398686.ute.st2-1/results/ResultDir/PrintServiceLookup_2D/PrintServiceLookup_2D.log

Reproducible: Always
Reproducible on machine: see comments
Is it a Regression: No 
Is it a platform specific issue: Yes

Test run log location: http://aurora.ru.oracle.com/functional/faces/RunDetails.xhtml?names=398686.ute.st2-1

Steps to reproduce: 
export DISPLAY=:0
mkdir -p /export/local/junk/
cd /export/local/junk
echo "#PrintServiceLookup_2D
test.case.name=PrintServiceLookup_2D
TEST_CASE_BASE=Automated/PrintServiceLookup_2D
2D_Printing/Testcase dtonga \"PrintServiceLookup_2D\"
" > my.testlist
/net/vmsqe.ru.oracle.com/export/gtee/bin/jdk install_bundles -srcdirbase /net/vice.ru.oracle.com/export/home0/jdk  -release 1.7.0_55 -build b07 -jdkrename true  -arch linux-i586 -type tar
/net/vmsqe.ru.oracle.com/export/gtee/bin/jdk install_bundles -srcdirbase /net/vice.ru.oracle.com/export/home0/jdk  -release 1.7.0_51 -build b05 -jdkrename true  -arch linux-i586 -type tar
/net/stt-13.ru.oracle.com/export/home0/ute-dev/bin/ute run -harness  tonga -component 2d -jdk /export/jdk/jdk1.7.0_55b07 -stablejavahome  "/export/jdk/jdk1.7.0_51b05" -env "BASEBUILD=/export/jdk/jdk1.7.0_51b05" -testbase /net/stt-13.ru.oracle.com/export/home0//testsuites/170_user_ws/fox/ws170/2d -testlist my.testlist -results . 



History:
http://aurora.ru.oracle.com/functional/faces/ChessBoard.xhtml?reportName=J2SETestHistory&parameters=%5BtestNameFilterRegExp%5D2D_Printing%2FPrintServiceLookup_2D%5Bjdkproduct%5DJava%28TM%29%25%5Brelease%5D1.7%25%5Bbuild%5D%25%5Bvmproduct%5DJava%25VM%25%5Bvmrelease%5D%25%5Bvmbuild%5D%25%5Bcomponent%5D%25%5Btags%5D%25%5BstartDate%5DSep+10%2C+2009+1%3A00%3A00+AM+MSD%5BendDate%5DSep+10%2C+2020+1%3A00%3A00+AM+MSK%5BrunNames%5D%27%27%5BbatchNames%5D%27%27%5BbatchNameFilterRegExp%5D%25%5BrunNameFilterRegExp%5D%25%5BtestsuiteNameFilterRegExp%5D%25%5Bstatuses%5Dfailure.status+%3D+com.sun.aurora.data.entity.reporting.Status.FAILED+AND+failure.isValid+%3D+true+AND+%28%3Amatches%29%5Bmatches%5D%281%3D1%29%5Bbundles%5Dnone&splitting=%5BZ+axis%5D%5BY+axis%5Drelease%2C+build%2C+failure%2C+reason%2C+productConfiguration%2C+date%2C+buildType%5BX+axis%5Dos%2C+bitness%5BComplement%5Dvmrelease%2C+vmbuild%2C+VMVersionString%2C+JDKVersionString%2C+tags%2C+groups%2C+platform%2C+truncatedProductConfiguration%2C+VMMode%2C+JDKProfile%2C+VMFlavor%2C+hostname%2C+osFlavor%2C+osVersion%2C+buildDate%2C+msDate%2C+baseline%2C+emb_arch%2C+batch%2C+runName%2C+harness%2C+testbaseVersion%2C+testbase%2C+fullTestsuite%2C+testsuite%2C+component%2C+baselineName%2C+crs%2C+bugType%2C+duration&reference=%5BOthers%5Drelease%2C+build%2C+vmrelease%2C+vmbuild%2C+VMVersionString%2C+JDKVersionString%2C+tags%2C+groups%2C+platform%2C+truncatedProductConfiguration%2C+buildType%2C+bitness%2C+productConfiguration%2C+VMMode%2C+JDKProfile%2C+VMFlavor%2C+hostname%2C+os%2C+osFlavor%2C+osVersion%2C+date%2C+buildDate%2C+msDate%2C+baseline%2C+emb_arch%2C+batch%2C+runName%2C+harness%2C+testbaseVersion%2C+testbase%2C+fullTestsuite%2C+testsuite%2C+component%2C+baselineName%2C+failure%2C+reason%2C+crs%2C+bugType%2C+duration%5BReference+Set%5D&mixReference=false&flags=&significance=empty&hideDataConfiguration=true&calculateSummary=false&showSummaryExpanded=false&showSummaryContents=true&showComplementAttributes=false&compactTables=true&viewStyle=chessboard&filter=&filter_override=
Comments
It seems "tta_printer" was added using lpadmin -p printer-name -E -v device -m ppd so it becomes a "Remote Printer" and even though Java sees that printer, it calls getUnsupportedAttributes() on that printer service to see if that printer matches the DocFlavor. In this case, this remote printer does not have any supported doc flavor listed so when getSupportedDocFlavors() is called, it does not see any "document-format-supported" attribute. Although JDK-8040139 fixed this problem by adding DocFlavor.SERVICE_FORMATTED.PAGEABLE and DocFlavor.SERVICE_FORMATTED.PRINTABLE to the supported DocFlavors since as per spec, https://docs.oracle.com/javase/8/docs/api/index.html?javax/print/PrintService.html it clearly says, getSupportedDocFlavors() Returns: Array of supported doc flavors, should have at least one element. the returned flavours are not populated to supported DocFlavors called by IPPPrintService.java#getUnsupportedAttributes() -> isDocFlavorSupported() so "supportedDocFlavors" was still null for this case and isDocFlavorSupported() returns false. I added a fix to populate the PAGEABLE & PRINTABLE docflavor to "supportedDocFlavors" and tested in sqe machine and found it working.
04-03-2016

Reproduced with 1.8.0_65 b9 (1.8.0_65-b09) on spb23285.ru.oracle.com test log: http://aurora.ru.oracle.com/slot-gw/1093506.ute.st2-1/results/ResultDir/PrintServiceLookup_2D/PrintServiceLookup_2D.log lpstat -v listed 2 printers bash-4.1$ lpstat -v device for tta_printer: ipp://st-tta-adc-02.us.oracle.com/printers/tta_printer device for Xerox-WorkCentre-4250: socket://spb04p12.ru.oracle.com:9100 test failed
19-08-2015

ok
29-07-2014

I shall check earliest affected release.
14-02-2014

what is the ealiest affected release? 7u55? why did you say this is regression: NO in this case?
12-02-2014