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 250558 - Cannot paste clipboard content from other application
Summary: Cannot paste clipboard content from other application
Status: RESOLVED INCOMPLETE
Alias: None
Product: platform
Classification: Unclassified
Component: Actions (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P2 normal with 1 vote (vote)
Assignee: Jan Peska
URL:
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2015-02-19 21:19 UTC by bht
Modified: 2015-07-29 09:05 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
messages.log (694.89 KB, application/octet-stream)
2015-02-19 21:19 UTC, bht
Details
Complete log files in zip file (75.04 KB, application/zip)
2015-02-28 06:26 UTC, bht
Details
Log file (142.43 KB, application/octet-stream)
2015-03-24 19:02 UTC, rudyment
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bht 2015-02-19 21:19:45 UTC
Created attachment 152102 [details]
messages.log

I copy some text from the FireFox browser onto the clipboard.

Then I switch to the NetBeans Java editor and paste it.

The editor adds text that I had on the clipboard previously, copied from within the editor, before I copied from the web page.

Then I open Notepad and paste. Notepad gets the content from the wep page as expected.

Even the IDE's Menu|File||Open File... dialog's paste uses the old content, so I cannot paste the file path of the log file into the editor to view it.

Since this is probably in the random category, please do not expect me to change configuration and provide further data. That could be frustrating and unproductive. I hope that by now, all information that is required to solve this issue is in the attached log file.

...

I have been a NetBeans user and advocate for as long as the product exists, and I have submitted perhaps over 200 issue reports, most of them with test cases.

There is of course the obvious question how it is possible that a single user can be affected by so many issues.

Please keep in mind that the negative effect of issues like this cannot be compensated by new features, marketing or whatever.

There exist niches for any product, because people just have different taste. We have to start talking about niches because NetBeans does not have market share. But this kind of thing is just to much for anyone to take and users will reach a tipping point and throw the product out.

I am suggesting that members of the NetBeans team start learning about such tipping points.
Comment 1 Geertjan Wielenga 2015-02-26 14:04:36 UTC
Tried to reproduce it but NetBeans is too good:

https://www.youtube.com/watch?v=0RTV3kQ7kF0

No sound, just screencast showing me doing exactly what you describe.
Comment 2 Ondrej Vrabec 2015-02-26 14:44:40 UTC
The log is useless, full of java.lang.NullPointerException
	at org.eclipse.persistence.jpa.jpql.tools.JPQLQueryContext.getType(JPQLQueryContext.java:654)
exceptions. Please restart the IDE, copy the text from outside, try to paste it and attach the log again immediately.
Thanks
Comment 3 Geertjan Wielenga 2015-02-27 12:21:17 UTC
Deleted the YouTube clip above. Made a new one with a lot more content:

https://www.youtube.com/watch?v=wrQXtc9B50s

Thanks for inspiring me to make the above.
Comment 4 Ondrej Vrabec 2015-02-27 14:37:50 UTC
this is likely related to used JRE and possibly a duplicate of bug 249446.
> Since this is probably in the random category, please do not expect me to change configuration and provide further data. That could be frustrating and unproductive. I hope that by now, all information that is required to solve this issue is in the attached log file.
Yeah, i know you won't like it but: the log was useless and does not contain the beginning part.
Comment 5 bht 2015-02-28 06:26:49 UTC
Created attachment 152295 [details]
Complete log files in zip file

My apologies for the partial log file. I still had all log files so hopefully this makes a difference.
Comment 6 Ondrej Vrabec 2015-02-28 08:11:41 UTC
Nothing suspicious in the log i could find. You can try upgrading to a newer JDK, you are still using a relatively old 1.7.0_25. But as you said it was a random issue i doubt you will be able to tell if it fixes anything.
Comment 7 Geertjan Wielenga 2015-02-28 09:22:13 UTC
Indeed -- get the latest JDK, register it in netbeans.conf, probably remove the user directory, and then restart. You should be able to do all the things I show in the YouTube clip above.
Comment 8 bht 2015-03-01 23:37:39 UTC
Thanks for the ideas. Meanwhile I have upgraded to Java 1.8 as suggested.

While it is useful to put this into the random category, one issue stands out in this context: The massive volume of exceptions in the log thrown by JPQL processing. We are facing a high probability that this caused the cut and paste problem. Whenever I am using JPA entities that contain a non-trivial amount of of JPQL quieries in @NamedQueries then the IDE stops working normally.

I think at the time of the error I had code like the following

@NamedQueries({
    @NamedQuery(name = Request.FIND_ALL, query = "SELECT object(req) from Request req"),
    // Next one fails in various permutations due to bug: https://issues.apache.org/jira/browse/DERBY-5629 - even the cast workaround fails.
    @NamedQuery(name = Request.FIND_BY_PARAMETERS, query
            = "select\n"
            + "object(req) from Request req\n"
            + "where\n"
            + "("
            // organisation name
            + "((cast(:organisationName as string)is null)\n"
            + "or\n"
            + "(req.organisation.organisationName = cast(:organisationName as string)))\n"),
})

I would like to refer to bugs 217398 and 212951. I am not up to date on this subject at the moment as I am more in a state of resignation.

My opinion is that stuffing complex queries into Java strings in annotations or whatever other file type like XML is just crazy, and expecting the IDE to resolve this is even crazier.

Then letting this madness have a significant impact on IDE performance is just tragic.

I know this, I have experienced it many times. I can only suggest to make this optional in the IDE, such as a plugin. Not just the code hints, I mean the whole processing that leads to the CPU consumption and these errors.

I don't think that the IDE gets a lot of bonus points by being able to code-complete trivial single line JPQL statements in Java files.

NetBeans should just wait perhaps for another 10 years until people start to realize that JPQL in Java source file strings was a bad ideas, or until this matures as it obviously has not.
Comment 9 Ondrej Vrabec 2015-03-03 14:41:07 UTC
(In reply to bht from comment #8)
> Thanks for the ideas. Meanwhile I have upgraded to Java 1.8 as suggested.
If the upgrade helps please close this bug.
> While it is useful to put this into the random category, one issue stands
> out in this context: The massive volume of exceptions in the log thrown by
> JPQL processing. We are facing a high probability that this caused the cut
> and paste problem. Whenever I am using JPA entities that contain a
> non-trivial amount of of JPQL quieries in @NamedQueries then the IDE stops
> working normally.
Could you please file a separate issue for this in javaee/persistance? The owner of that module will definitely know more about it than me.
Comment 10 rudyment 2015-03-24 19:02:03 UTC
Created attachment 152826 [details]
Log file
Comment 11 rudyment 2015-03-24 19:03:35 UTC
I have the same problem.
NetBeans are not able accept contents of the clipboard saved outside of them.
I use JDK 8 update 40.
When I want repair it, I have to restart NB.
Comment 12 Ondrej Vrabec 2015-07-17 11:32:09 UTC
Sorry, i really don't know how to reproduce, works even on Windows. If any of you suffer from this regularly, there is a logging that can be switched on.
Run NetBeans with -J-Dorg.netbeans.NbClipboard.level=FINE
Then every time you switch to an external app, copy something and switch back, the IDE log should be updated with a lot of log messages.
When the issue happens again, please try to pick the messages added when switched to NetBeans and attach them here.
If you know how to reproduce reliably, you're very welcome to share the steps to reproduce.

Thanks.
Comment 13 bht 2015-07-18 21:37:14 UTC
I have set the logging as suggested for months and the error did not reproduce. The logging has an impact in that the log overflows and other issues are masked so I had to turn it off. This happens very rarely and I cannot reproduce it.
Comment 14 Quality Engineering 2015-07-19 01:17:53 UTC
Integrated into 'main-silver', will be available in build *201507190001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/e3724ebe83fb
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: Task #250558 - Cannot paste clipboard content from other application

Limit number of lines logged in FINE level to make the logging a bit more readable.
Comment 15 Ondrej Vrabec 2015-07-29 09:05:57 UTC
OK, one more think to try: if it happens again, try generating a heap dump, it's possible that the clipboard synchronize task gets stuck because of too many scheduled tasks.