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 227236 - Netbeans 7.3 IDE causes MS Excel 2010 clipboard problem: "clipboard cannot be emptied" + Exel crash!
Summary: Netbeans 7.3 IDE causes MS Excel 2010 clipboard problem: "clipboard cannot be...
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 7.3
Hardware: PC Windows 7 x64
: P2 normal with 1 vote (vote)
Assignee: Stanislav Aubrecht
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-09 14:29 UTC by fassev
Modified: 2013-11-29 02:54 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Excel with clipboard problems (95.41 KB, image/png)
2013-03-09 14:29 UTC, fassev
Details
Excel 2010 crash (91.15 KB, image/png)
2013-03-09 14:30 UTC, fassev
Details
NetBeans 7.3 message.log (52.24 KB, application/octet-stream)
2013-03-11 12:55 UTC, fassev
Details
NetBeans 7.2 message log (48.61 KB, application/octet-stream)
2013-03-11 12:56 UTC, fassev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description fassev 2013-03-09 14:29:54 UTC
Created attachment 132403 [details]
Excel with clipboard problems

When I am running Netbeans and MS Excel 2010 parallel on Windows 7 64 Bit I observe a problem within Excel, when I am copying with Ctrl-C some cells. When I select in Excel a cell and click 6 Times Ctrl-C the Excel shows each time a well known  message:

"Can't empty the clipboard!"

After that Excel CRASHES and restarts itself by loosing the last changes. I am providing two snapshots only, as I don't have any clipboard entries in the NetBeans message.log. 

The problem DOES NOT exist in the NetBeans 7.2.1 version, and in Version NetBeans 7.3.2 betta at least the Excel does not crash after the clipboard error message is shown!

The Excel behavior is observed ONLY when the NetBeans IDE is running in the background. Only stopping the NetBeans IDE resolves the Excel clipboard problem.

I also tried stopping all other programs and services, like Skype etc. but the problem definitely occurs only when Excel and NetBeans are rinnung together. At least on my machine the Excel clipboard is functioning perfectly even with Skype running in the background or with other Java programs like FindBugs (pure Java) or Eclipse - which means that the Java itself is probably not the problem. Thus I strongly suppose, that the problem is cases by NetBeans!

Well, you may say that this is an Excel problem, but I think, that NetBeans should also check and possibly rethink its own Clipboard handling mechanism. The system wide clipboard or its elements should not be blocked by NetBeans - if possible.

I have tried both "-Dnetbeans.slow.system.clipboard.hack=true" and "-Dnetbeans.slow.system.clipboard.hack=false" without success. Unfortunately there is no error message in the NetBeans message.log concerning the clipboard.

Are there any other clipboard options in NetBeans, which I may try? For instance, is it possible to stop the clipboard copy history?

Due to this error, I am going to switch back to NetBeans 7.2.1.

Regards
PF
Comment 1 fassev 2013-03-09 14:30:29 UTC
Created attachment 132404 [details]
Excel 2010 crash
Comment 2 Marian Mirilovic 2013-03-11 11:42:14 UTC
Are you using the same JDKs for 7.3 & 7.2.1 , could you please double ckeck ? if so, could you run any other Java application (e.g. Swing Demo) and try to reproduce the problem ? 

Please provide requested information and reopen, thanks in advance.
Comment 3 fassev 2013-03-11 12:04:33 UTC
Please read my previous description! As already stated, yes, I did checked this with other Java Programs and yes the problem occures only with 7.3 but NOT with 7.2.1. I am working since friday with NetBeans 7.2.1 and Excel is working fine. The swing demo is also not causing any problems.


I have just tryied NetBeans 7.3 again, and Excel crashed immediatly after 6 Copy & Paste actions.
Comment 4 Marian Mirilovic 2013-03-11 12:08:46 UTC
Could you please attach messages.log file from 7.2.1 & from 7.3 ? Thanks in advance.
Comment 5 fassev 2013-03-11 12:20:03 UTC
And yes, I am using the same JDK (build 1.7.0_15-b03) for both NetBeans 7.2.1 and 7.3. Here is the About-Info:

++ NetBeans 7.2.1:
Product Version: NetBeans IDE 7.2.1 (Build 201210100934)
Java: 1.7.0_15; Java HotSpot(TM) 64-Bit Server VM 23.7-b01
System: Windows 7 version 6.1 running on amd64; Cp1252; de_DE (nb)
User directory: C:\Users\...\AppData\Roaming\NetBeans\7.2.1
Cache directory: C:\Users\..\AppData\Local\NetBeans\Cache\7.2.1


++ NetBeans 7.3
Product Version: NetBeans IDE 7.3 (Build 201302132200)
Java: 1.7.0_15; Java HotSpot(TM) 64-Bit Server VM 23.7-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_15-b03
System: Windows 7 version 6.1 running on amd64; Cp1252; de_DE (nb)
User directory: C:\Users\...\AppData\Roaming\NetBeans\7.3
Cache directory: C:\Users\...\AppData\Local\NetBeans\Cache\7.3
Comment 6 fassev 2013-03-11 12:55:00 UTC
Created attachment 132457 [details]
NetBeans 7.3 message.log

Message Log NetBeans 7.3
Comment 7 fassev 2013-03-11 12:56:39 UTC
Created attachment 132458 [details]
NetBeans 7.2 message log
Comment 8 Jaroslav Tulach 2013-03-12 14:06:13 UTC
Should not you report this bug to Microsoft? We don't maintain Excel!
Comment 9 fassev 2013-03-12 14:37:52 UTC
Yes, I have asked myself the same question, but I think both Microsoft and NetBeans should check their part!

The Crash of Excel is definitely a Microsoft problem, but just before that happens, there is a message in Excel like "Could not empty the clipboard". This means that NetBeans is holding the entries in the Clipboard. 
Is it possible to check this behavior in NetBeans, i.e. not to hold locks in the system clipboard? It seems for me that NetBeans is permanently listening on changes of the global clipboard and immediately handling them … perhaps in order to update the status of some menu or title bar items? 

First I thought, that may be the NetBeans handler is not fast enough, when he enumerates the clipboard items, thus causing Clipboard locks or congestion. But this is NOT the cause. Even if I do repeat “Cntrl-C” very slowly (5 seconds between two clicks), after the 6 click there comes the Excel message “Can not open the Clipboard” or “Can not empty the clipboard”. So what is going on? Is NetBeans or Java somehow holding some locks in the clipboard?
Comment 10 Jaroslav Tulach 2013-03-21 12:41:52 UTC
This is the file responsible for clipboard access and yes, it does frequent polling:

http://hg.netbeans.org/releases/annotate/release73/o.n.bootstrap/src/org/netbeans/NbClipboard.java

Yes, there were some changes in 7.3. The old behavior should be achievable via properties (shown in the source), you may try to play with their values.

To understand what the code does during runtime, you may turn on logging. If you find a way (properties, a patch) that NetBeans can co-exist with Excel, let us know. We may make it default. Meanwhile, closing as invalid - let us know how your report to Microsoft will have succeeded.
Comment 11 supermaz 2013-04-10 13:56:08 UTC
Just to inform you: This also affects e.g. GIMP and OpenOffice on linux. When copying things in GIMP the cursors continuously flickers and CPU usage goes up. In OpenOffice you can see the status bar also flicker.

So I guess this must really be fixed.
Comment 12 supermaz 2013-04-10 13:56:24 UTC
Just to inform you: This also affects e.g. GIMP and OpenOffice on linux. When copying things in GIMP the cursors continuously flickers and CPU usage goes up. In OpenOffice you can see the status bar also flicker.

So I guess this must really be fixed.
Comment 13 pwade 2013-05-09 22:00:49 UTC
Why is this marked RESOLVED INVALID?  This is an issue not just with Excel but with other programs and the clipboard as well.  It's definitely not invalid as this issue only occurs when running NB 7.3+.  I'm running the nightly from 5/7 and the issue is still occurring.  When I run NB 7.0 (same JDK) I don't have this issue.  Therefore a change was made which has affected the clipboard behavior and it's been verified by several people.  Seems to me this should be reopened and fixed.
Comment 14 pwade 2013-05-09 22:04:45 UTC
I take it back.  7.0.1 is broken as well.  Just took awhile before it actually effected the clipboard.  C'est la vie.  Very annoying issue.
Comment 15 DeveloperChris 2013-06-25 03:27:37 UTC
I am experiencing this issue. It is apparent that microsoft have had this issue for a long time. through several iterations of excel.

I think we can rule out that behemoth fixing it anytime soon.

It's is not only netbeans that causes the problem. but it is still a problem and should be tackled.

from the code indicated above
    // ttran@12136 	
    // sun.awt.datatransfer.ClipboardTransferable.getClipboardData() can hang
    // for very long time (maxlong == eternity).  We tries to avoid the hang by
    // access the system clipboard from a separate thread.  If the hang happens
    // the thread will wait for the system clipboard forever but not the whole
    // IDE

If this thread is hanging it probably locks the clipboard resulting in Excells error

This would a appear to be an oracle issue - go figure.

This might also explain why sometimes netbeans refuses to close when shutting down windows.
Comment 16 DeveloperChris 2013-10-20 06:08:26 UTC
just to add to this. Its getting annoying!

Similar problems occur with mysql workbench when netbeans is open. I have never experienced this issue with any other JAVA application.

For example Eclipse doesnt cause this problem

P.S. Netbeans Eclipses Eclipse for PHP applications :)
Comment 17 Stanislav Aubrecht 2013-11-27 10:44:43 UTC
core-main 43811a4f8b07
Comment 18 Quality Engineering 2013-11-29 02:54:07 UTC
Integrated into 'main-silver', will be available in build *201311290002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/43811a4f8b07
User: S. Aubrecht <saubrecht@netbeans.org>
Log: #227236 - don't react to system clipboard changes when the IDE window is in the background