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

[macosx] Cannot open certain Url with Desktop class on Mac

XMLWordPrintable

    • x86
    • linux

      FULL PRODUCT VERSION :
      java version "1.8.0_65"
      Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
      Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Darwin macpro 14.5.0 Darwin Kernel Version 14.5.0: Tue Sep 1 21:23:09 PDT 2015; root:xnu-2782.50.1~1/RELEASE_X86_64 x86_64

      A DESCRIPTION OF THE PROBLEM :
      Cannot open certain Urls with the Desktop awt class. I have an example for one, but there may be more.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the provided code

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Following web page opened in my default web browser:
      https://es.wikipedia.org/wiki/Gato_%28desambiguación%29
      ACTUAL -
      Crashes

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Exception in thread "main" java.lang.RuntimeException: Non-Java exception raised, not handled! (Original problem: *** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0])
      at sun.lwawt.macosx.CDesktopPeer._lsOpenURI(Native Method)
      at sun.lwawt.macosx.CDesktopPeer.lsOpen(CDesktopPeer.java:69)
      at sun.lwawt.macosx.CDesktopPeer.browse(CDesktopPeer.java:65)
      at java.awt.Desktop.browse(Desktop.java:386)
      at bugkiller.BugKiller.main(BugKiller.java:21)

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------

      package bugkiller;

      import java.awt.Desktop;
      import java.net.URI;

      public class BugKiller {

      /**
      * @param args the command line arguments
      */
      public static void main(String[] args) throws Exception {
      Desktop.getDesktop().browse(new URI(
      "https://es.wikipedia.org/wiki/Gato_%28desambiguación%29"));
      }

      }
      ---------- END SOURCE ----------

            pardesha Pardeep Sharma
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: