Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Thread.setDefaultUncaughtExceptionHandler not working in bundled app (in Lion?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Thread.setDefaultUncaughtExceptionHandler not working in bundled app (in Lion?)



Possibly, but we'd still love to see your testcase at <http://bugreporter.apple.com> to diagnose on a wider range of configs.

Thanks,
Mike Swingler
Java Engineering
Apple Inc.

On Jul 30, 2011, at 10:30 AM, Steve McLeod wrote:

> After carefully constructing a reproducible test case and writing this
> message, I just got a report from a user with the problem who is NOT
> using Lion. So perhaps it is the current Java update that is at fault?
>
> On Sat, Jul 30, 2011 at 11:12 AM, Steve McLeod <email@hidden> wrote:
>
>> Hi there,
>>
>> In my Mac OS X Java desktop app,
>> Thread.setDefaultUncaughtExceptionHandler is not working any more. As
>> far as I can tell, this is the case since upgrading to Lion, although
>> I can't be certain.
>>
>> Here's a reproducible test case:
>>
>> package com.barbarysoftware.crashtest;
>>
>> import javax.swing.*;
>>
>> public class Launcher {
>>     public static void main(String[] args) {
>>         Thread.setDefaultUncaughtExceptionHandler(new
>> Thread.UncaughtExceptionHandler() {
>>             public void uncaughtException(Thread t, Throwable e) {
>>                 System.out.println("Launcher.uncaughtException");
>>                 JOptionPane.showMessageDialog(null, "in
>> Launcher.uncaughtException");
>>             }
>>         });
>>         throw new RuntimeException("Foobar");
>>     }
>> }
>>
>> If I jar this and run from the command line, I see a dialog box as expected.
>> java -jar CrashTest.jar
>>
>> If I bundle this into a DMG using Jar Bundler, then it crashes
>> silently. The system log has the following message:
>> Jul 30 11:04:05 Steve-McLeods-MacBook-Pro
>> [0x0-0x636636].com.barbarysoftware.crashtest.Launcher[28000]:
>> [LaunchRunner Error]
>> com.barbarysoftware.crashtest.Launcher.main(String[]) threw an
>> exception:
>> Jul 30 11:04:05 Steve-McLeods-MacBook-Pro
>> [0x0-0x636636].com.barbarysoftware.crashtest.Launcher[28000]:
>> java.lang.RuntimeException: Foobar
>> Jul 30 11:04:05 Steve-McLeods-MacBook-Pro
>> [0x0-0x636636].com.barbarysoftware.crashtest.Launcher[28000]: at
>> com.barbarysoftware.crashtest.Launcher.main(Launcher.java:14)
>> Jul 30 11:04:05 Steve-McLeods-MacBook-Pro
>> [0x0-0x636636].com.barbarysoftware.crashtest.Launcher[28000]: at
>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> Jul 30 11:04:05 Steve-McLeods-MacBook-Pro
>> [0x0-0x636636].com.barbarysoftware.crashtest.Launcher[28000]: at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> Jul 30 11:04:05 Steve-McLeods-MacBook-Pro
>> [0x0-0x636636].com.barbarysoftware.crashtest.Launcher[28000]: at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> Jul 30 11:04:05 Steve-McLeods-MacBook-Pro
>> [0x0-0x636636].com.barbarysoftware.crashtest.Launcher[28000]: at
>> java.lang.reflect.Method.invoke(Method.java:597)
>> Jul 30 11:04:05 Steve-McLeods-MacBook-Pro
>> [0x0-0x636636].com.barbarysoftware.crashtest.Launcher[28000]: at
>> apple.launcher.LaunchRunner.run(LaunchRunner.java:116)
>> Jul 30 11:04:05 Steve-McLeods-MacBook-Pro
>> [0x0-0x636636].com.barbarysoftware.crashtest.Launcher[28000]: at
>> apple.launcher.LaunchRunner.callMain(LaunchRunner.java:51)
>> Jul 30 11:04:05 Steve-McLeods-MacBook-Pro
>> [0x0-0x636636].com.barbarysoftware.crashtest.Launcher[28000]: at
>> apple.launcher.JavaApplicationLauncher.launch(JavaApplicationLauncher.java:52)
>>
>> Here's some info:
>>
>> Mac OS X 10.7
>> java version "1.6.0_26"
>> Jar Bundler 14.0.3
>>
>> For years the code in question has been working. As far as I can tell,
>> the problem started when switching to Lion. However I currently can't
>> test that hypothesis, as I'm away for some weeks from my normal
>> development setup.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.