<div dir="ltr">Hi - this issue was originally discussed on the jdk7u-dev list here:<br><a href="http://mail.openjdk.java.net/pipermail/jdk7u-dev/2013-May/006446.html">http://mail.openjdk.java.net/pipermail/jdk7u-dev/2013-May/006446.html</a><br>
<br>Additionally a report should be available soon in the bug database as (JDK-8015302)<br><a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8015302">http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8015302</a><br>
<br>To summarize, a bundled mac application which registers custom url schemes via the CFBundleURLSchemes entry in its Info.plist, and listens for uri events using com.apple.eawt.Application.setOpenURIHandler, will not receive the URI used to launch the application.<br>
<br>Once the application is running however, subsequent openURI events will be delivered without issue. The problem only manifests with the URI is used to launch the App initially.<br><br>When the app is opened via URI, the following appears in the system log:<br>
<br>----------<br>JavaAppLauncher[74278]: -[NSAppleEventDescriptor<br>paramDescriptorForKeyword:] called on invalid NSAppleEventDescriptor<br>----------<br><br>It appears that since the QueueingApplicationDelegate is only keeping<br>
references to those descriptor objects instead of making deep copies of them,<br>the event descriptor for the initial URI that launches the app is<br>invalidated by the time the app actually gets around to processing it.<br>
<br>The following patch (same for both jdk8 and jdk7u sources) seems to resolve the issue:<br><br>----<br>diff --git a/src/macosx/native/sun/osxapp/QueuingApplicationDelegate.m b/src/macosx/native/sun/osxapp/QueuingApplicationDelegate.m<br>
--- a/src/macosx/native/sun/osxapp/QueuingApplicationDelegate.m<br>+++ b/src/macosx/native/sun/osxapp/QueuingApplicationDelegate.m<br>@@ -110,8 +110,14 @@<br> <br> - (void)_handleOpenURLEvent:(NSAppleEventDescriptor *)openURLEvent withReplyEvent:(NSAppleEventDescriptor *)replyEvent<br>
 {<br>+    // Make an explicit copy of the passed events as they may be invalidated by the time they&#39;re processed<br>+    NSAppleEventDescriptor *openURLEventCopy = [openURLEvent copy];<br>+    NSAppleEventDescriptor *replyEventCopy = [replyEvent copy];<br>
+<br>     [self.queue addObject:[^(){<br>-        [self.realDelegate _handleOpenURLEvent:openURLEvent withReplyEvent:replyEvent];<br>+        [self.realDelegate _handleOpenURLEvent:openURLEventCopy withReplyEvent:replyEventCopy];<br>
+        [openURLEventCopy release];<br>+        [replyEventCopy release];<br>     } copy]];<br> }<br>-----<br><br>Please let me know if there is additional information that I can provide - thanks!<br><br>-James</div>