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

closed test javax/print/SupportedMedia.java failed on Windows

    XMLWordPrintable

Details

    • 2d

    Description

      This closed test javax/print/SupportedMedia.java failed in CI as follows when running on Windows Server 2016

      java.lang.NullPointerException: Cannot invoke "javax.print.PrintService.getName()" because "<local4>[<local5>]" is null
      at SupportedMedia.<init>(SupportedMedia.java:77)
      at SupportedMedia.main(SupportedMedia.java:182)
      at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
      at java.base/java.lang.reflect.Method.invoke(Method.java:580)
      at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
      at java.base/java.lang.Thread.run(Thread.java:1575)

      JavaTest Message: Test threw exception: java.lang.NullPointerException: Cannot invoke "javax.print.PrintService.getName()" because "<local4>[<local5>]" is null
      JavaTest Message: shutting down test

      STATUS:Failed.`main' threw exception: java.lang.NullPointerException: Cannot invoke "javax.print.PrintService.getName()" because "<local4>[<local5>]" is null

      The line of code it fails at is nothing special and is really nothing to do with the specifics of what this test is about, instead it fails just getting the printers on which it will run the test.

                PrintService[] services =
                      PrintServiceLookup.lookupPrintServices(flavor, null);

                  for(int i = 0 ;i < services.length;i++) {
                          System.out.println("PRINT SERVICE " + services[i].getName()); << failure here at line 77

      The only way this can happen is if we populated the array with a null entry.
      That should never happen.

      although this was seen in JDK 23 CI, I have no reason at all to suppose it is a new problem, more likely it is something about the system on which it is running that tickled an existing problem.

      Perhaps we got "null" for the default printer (because no printer is configured as the system default) and incorrectly added that ?

      But why didn't other tests fail similarly ? Surely this can't be the only such test in that task ?

      Attachments

        Activity

          People

            psadhukhan Prasanta Sadhukhan
            prr Philip Race
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: