|
From: Peter De B. (JIRA) <no...@at...> - 2007-11-30 13:01:19
|
[ http://opensource.atlassian.com/projects/spring/browse/RCP-493?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Peter De Bruycker resolved RCP-493.
-----------------------------------
Assignee: Peter De Bruycker
Resolution: Fixed
as the javadoc of Clipboard.getContents state: the IllegalStateException can be thrown when the clipboard is not available (i.e. in use by another application).
The exception occurs when the check to see if the Paste menu item must be enabled/disabled occurs.
As this check is driven by a timer, it's safe to catch the exception, and set the paste menu item to false. The next time the check occurs, the clipboard will be available again, and it will work correctly.
> cannot open system clipboard
> ----------------------------
>
> Key: RCP-493
> URL: http://opensource.atlassian.com/projects/spring/browse/RCP-493
> Project: Spring Framework Rich Client Project
> Issue Type: Bug
> Affects Versions: 0.3.0
> Environment: Windows, JRE 1.5.0_12
> Reporter: Benoit Xhenseval
> Assignee: Peter De Bruycker
>
> Hi All,
> From time to time, switching back to a Spring RC window (ALT+TAB) from another Windows application seems to trigger this exception:
> java.lang.IllegalStateException: cannot open system clipboard
> I have not been able to reproduce this issue reliably, it happens from time to time.
> The stacktrace seems to be entirely in SpringRC/Swing.
> The issue faced is that the exception is thrown all the way to the user and there is no known things that I could do to remediate it. Furthermore, this does not seem to affect the application at all... so my suggestion would be to catch this exception in TextComponentPopup and simply log a warning?
> I know it would be better to find the root cause but that seems to be between Windows and the JRE...
> Has anyone seen this?
> java.lang.IllegalStateException: cannot open system clipboard
> java.lang.IllegalStateException: cannot open system clipboard
> at sun.awt.windows.WClipboard.openClipboard(Native Method)
> at sun.awt.datatransfer.ClipboardTransferable.(ClipboardTransferable.java:61)
> at sun.awt.datatransfer.SunClipboard.getContents(SunClipboard.java:130)
> at org.springframework.richclient.text.TextComponentPopup.canPasteFromClipboard
> (TextComponentPopup.java:261)
> at org.springframework.richclient.text.TextComponentPopup.updatePasteStatus(TextComponentPopup.java:253)
> at org.springframework.richclient.text.TextComponentPopup.access$2
> (TextComponentPopup.java:252)
> at org.springframework.richclient.text.TextComponentPopup$1.actionPerformed(TextComponentPopup.java:106)
> at javax.swing.Timer.fireActionPerformed(Timer.java
> :271)
> at javax.swing.Timer$DoPostEvent.run(Timer.java:201)
> at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
> at java.awt.EventQueue.dispatchEvent(EventQueue.java
> :461)
> at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
> at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
> at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
> at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
> at java.awt.EventDispatchThread.run
> (EventDispatchThread.java:110)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/spring/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|