This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 156395 - SecurityException when pasting text
Summary: SecurityException when pasting text
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 6.x
Hardware: All Linux
: P3 blocker (vote)
Assignee: Stanislav Aubrecht
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-07 05:30 UTC by err
Modified: 2009-02-19 22:53 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
complete exception stacktrace (6.77 KB, text/plain)
2009-01-07 05:34 UTC, err
Details

Note You need to log in before you can comment on or make changes to this bug.
Description err 2009-01-07 05:30:36 UTC
The following exception occurs when a paste operation is performed to jVi's search dialog

  java.lang.SecurityException: All swing access to clipboard should be redirected to ExClipboard
          at org.netbeans.TopSecurityManager.checkWhetherAccessedFromSwingTransfer(TopSecurityManager.java:617)
          at org.netbeans.TopSecurityManager.checkPermission(TopSecurityManager.java:384)
          at java.lang.SecurityManager.checkSystemClipboardAccess(SecurityManager.java:1377)
          at sun.awt.X11.XToolkit.getSystemSelection(XToolkit.java:904)
          at org.netbeans.editor.BaseCaret.getSystemSelection(BaseCaret.java:716)
Full stacktrace is attached.

I can not reproduce this, it happens on linux but not windows. The error is reported by mpetras. It is filed as a jVi
bug at https://sourceforge.net/tracker2/?func=detail&atid=103653&aid=2388723&group_id=3653 ; I'm copying relevant
information. MPetras says it is 100% reproducible.

According to the jVi bug report:
  I do these steps to reproduce:

  1) Select some text in the editor with a mouse.
  2) Press Ctrl-C to copy it to the clipboard.
  3) bring up the search dialog with: /
  4) do Ctrl-V - I get the exception and the whole IDE is frozen

Note that the Ctrl-C and the Ctrl-V operations are NB/Swing bindings, not jVi code. The searchdialog is a JDialog with
a combobox containing and editable JTextField. I will look at jVi so the exception does not hang the IDE, but I don't
understand why there is an exception using standard components.
Comment 1 err 2009-01-07 05:34:54 UTC
Created attachment 75519 [details]
complete exception stacktrace
Comment 2 Petr Dvorak 2009-01-07 10:58:46 UTC
Probably not a P2 (?)
Comment 3 err 2009-01-07 16:08:36 UTC
> Probably not a P2 (?)

It does hang the IDE. (Though I'm hoping I can hack around it)
Comment 4 err 2009-01-07 16:18:04 UTC
I forgot to include platform info.
NOTE: does not fail on windows.

This is on Linux (Ubuntu 8.04 32-bit).
NetBeans 6.5 or NetBeans 7.0 dev.
jVi 1.2.1.alpha1 (NetBeans module ver. 1.2.1.12)
JDK 1.6.0_11 (aka JDK 6u11)
Comment 5 Vitezslav Stejskal 2009-01-07 16:44:51 UTC
I'm totally lost here... Hopefully somebody from core/winsys people could help.
Comment 6 Stanislav Aubrecht 2009-01-16 08:28:14 UTC
perhaps netbeans clipboard implementation isn't loaded because of ergonomics?
is the bug reproducible with ergonomics cluster turned off
Comment 7 Marian Petras 2009-02-08 19:06:21 UTC
I guess ergonomics started after NB 6.5 so it cannot cause this bug.
Comment 8 Stanislav Aubrecht 2009-02-09 17:01:09 UTC
> I guess ergonomics started after NB 6.5 so it cannot cause this bug.
right, i didn't notice it was reported against 6.5

but unless there are some steps to reproduce this bug i can't do anything about it
Comment 9 Marian Petras 2009-02-10 13:45:06 UTC
The steps to reproduce are in the initial description of the bug.
Comment 10 Stanislav Aubrecht 2009-02-10 14:25:35 UTC
the problem is that jvi search field selects the pasted text which on linux copies the text back to system clipboard i
presume. however this means that system clipboard is accessed from javax.swing.TransferHandler$TransferAction (the
original paste action) so netbeans security manager thinks somebody's trying to bypass our ExClipboard implemenation.
i recommend adding SwingUtilities.invokeLater to com.raelity.jvi.Search$SearchListener.insertUpdate(Search.java:193)