Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Help needed--Non-Java exception



I'm running a Java Web Start app under Java 1.4.1_01 on OS X 10.2.8. I get
the following exception intermittently (and, in one case described below,
consistently), and I'm hoping someone can give me a pointer on what the
problem might be:

java.lang.RuntimeException: Non-Java exception raised, not handled!
(Original problem: Unlocking Focus on wrong view (<NSWindowViewAWT:
0x532e980>))
at apple.awt.NSGraphicsContextAPI.unsetCurrentNSGraphicsContext(Native
Method)
at apple.awt.ContainerModel.unsetCurrentContext(ContainerModel.java:422)
at apple.awt.PeerPaintEvent.dispatch(PeerPaintEvent.java:178)
at apple.awt.CocoaEvent$1.run(CocoaEvent.java:86)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at apple.awt.CocoaEvent.dispatch(CocoaEvent.java:45)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.ja
va:230)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java
:183)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)

Nothing in the stack is my code -- it all appears to be Apple or standard
Java classes. Once the exception occurs, I get a steady stream of them (all
from the same address in NSWindowViewAWT) until I exit the app. They seem to
be associated with painting activity on the screen.

The exceptions do not occur on every execution, even when doing the same
user operations on a freshly booted machine. I can't detect anything working
significantly differently in the app when the exceptions occur, except that
painting to the screen takes a painfully long time and seems to be done in
small fragments (although all of that can happen even without the exceptions
present). Sometimes the exceptions start immediately -- before any user
input. Sometimes they never occur.

The one case where I have been able to generate the exception consistently
is this. I have a Panel with a CardLayout. One of the cards is a Canvas that
has a simple animation loop (repaint then sleep) that runs for a short time
in a separate thread and then exits. The UI also has a button with which I
can flip cards in the Panel. If the animated Canvas is showing and I flip
the Panel to another card *after* the animation is over, I get the
exception. If I flip the Panel earlier (while there's still an active
animation thread), I don't get an exception (unless they've already
started). I should also mention that the call to CardLayout.show() is done
in a daemon worker thread, not directly in the event thread that delivers
the ActionEvent from the button.

This is all strictly AWT code; we are using no lightweight components (and
no Swing) anywhere in the app. I'm also not doing anything that is
MRJ-specific; the same jar file runs fine on Windows with JRE 1.4.1 and JWS
1.2.

I can provide more details, including source code, but this is a pretty
large app and I don't know what might be relevant. I can also provide
instructions for downloading the app from our web site, in case it would
help to see it in action yourself.

Thanks in advance for any help.

Ted Hopp
email@hidden

newSLATE is your personal learning workspace
... on the web at http://www.newslate.com/
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Do not post admin requests to the list. They will be ignored.




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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.