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 219756 - ClassCastException: sun.awt.image.BufImgSurfaceData cannot be cast to sun.java2d.xr.XRSurfaceData
Summary: ClassCastException: sun.awt.image.BufImgSurfaceData cannot be cast to sun.jav...
Status: CLOSED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: JDK Problems (show other bugs)
Version: 7.3
Hardware: All All
: P1 normal with 2 votes (vote)
Assignee: Stanislav Aubrecht
URL: http://bugs.sun.com/bugdatabase/view_...
Keywords: JDK_8, RELNOTE
: 248774 257718 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-10-09 13:26 UTC by augcampos
Modified: 2017-09-27 19:44 UTC (History)
27 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 193290


Attachments
stacktrace (2.70 KB, text/plain)
2012-10-09 13:26 UTC, augcampos
Details
stacktrace (2.77 KB, text/plain)
2012-10-09 13:44 UTC, augcampos
Details
stacktrace (3.48 KB, text/plain)
2016-09-08 10:54 UTC, Tomas Mysik
Details
stacktrace (4.97 KB, text/plain)
2016-09-15 21:51 UTC, javydreamercsw
Details
stacktrace (5.05 KB, text/plain)
2016-09-16 17:12 UTC, javydreamercsw
Details
stacktrace (3.04 KB, text/plain)
2016-09-20 16:42 UTC, tbrunhoff
Details
stacktrace (3.10 KB, text/plain)
2016-09-24 13:49 UTC, tbrunhoff
Details
stacktrace (4.38 KB, text/plain)
2016-09-30 17:37 UTC, javydreamercsw
Details
stacktrace (3.82 KB, text/plain)
2016-11-23 19:14 UTC, Karol Harezlak
Details
stacktrace (3.48 KB, text/plain)
2017-03-10 19:15 UTC, ytn01
Details
Stacktrace of the error (4.21 KB, text/plain)
2017-08-16 15:19 UTC, wwarlock
Details

Note You need to log in before you can comment on or make changes to this bug.
Description augcampos 2012-10-09 13:26:51 UTC
Build: NetBeans IDE Dev (Build nbms-and-javadoc-9445-on-20120921)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.0-b02, Java(TM) SE Runtime Environment, 1.8.0-ea-b59
OS: Linux

Stacktrace: 
java.lang.ClassCastException: sun.awt.image.BufImgSurfaceData cannot be cast to sun.java2d.xr.XRSurfaceData
   at sun.java2d.xr.XRPMBlitLoops.cacheToTmpSurface(XRPMBlitLoops.java:145)
   at sun.java2d.xr.XrSwToPMBlit.Blit(XrSwToPMBlit.java:348)
   at sun.java2d.pipe.DrawImage.blitSurfaceData(DrawImage.java:959)
   at sun.java2d.pipe.DrawImage.renderImageCopy(DrawImage.java:578)
   at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:71)
   at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:1014)
Comment 1 augcampos 2012-10-09 13:26:54 UTC
Created attachment 125629 [details]
stacktrace
Comment 2 augcampos 2012-10-09 13:44:15 UTC
Created attachment 125631 [details]
stacktrace
Comment 3 Antonin Nebuzelsky 2015-02-09 15:05:11 UTC
*** Bug 248774 has been marked as a duplicate of this bug. ***
Comment 4 Martin Entlicher 2016-05-16 19:17:20 UTC
*** Bug 257718 has been marked as a duplicate of this bug. ***
Comment 5 nleck 2016-08-19 04:20:52 UTC
How can this be "wontfix"... the current NB builds are unusable on my machine. 

I have to restart the IDE when my monitor wakes up.
Comment 6 Chiana 2016-08-19 06:53:35 UTC
Because the bug is not in NB but rather in java runtime itself...
Comment 7 spector32 2016-08-24 10:07:35 UTC
I'm having this error every time I wake my PC.
Comment 8 NoBugs 2016-08-25 04:24:32 UTC
I think this is likely the exception that happens when Netbeans looks blank until you hover around or resize the window?

How is this a bug in Java when Netbeans 8.0 doesn't have this on Ubuntu 14.04?
Comment 9 Martin Balin 2016-08-25 13:23:50 UTC
The bug is caused by error in JDK, not in NetBeans. It happens when displays are changed. Workaround is to start NetBeans with this parameter:
 
-Dsun.java2d.xrender=false

Will be fixed in upcoming JDK 8 Update 112/121.
Good description of the problem can be found here:
https://stackoverflow.com/questions/34188495/how-can-i-work-around-the-classcastexception-in-java2d-bug-id-7172749
Comment 10 Tomas Mysik 2016-09-08 10:54:47 UTC
Created attachment 161968 [details]
stacktrace

editing maven enterprise project
Comment 11 javydreamercsw 2016-09-15 21:51:52 UTC
Created attachment 162069 [details]
stacktrace

Building a Maven project.
Comment 12 javydreamercsw 2016-09-16 17:12:52 UTC
Created attachment 162085 [details]
stacktrace

Maven task on project.
Comment 13 tbrunhoff 2016-09-20 16:42:56 UTC
Created attachment 162139 [details]
stacktrace

Nothing.  This machine has been ignored for the past week.  I logged in and got this exception. It might have had to do with the X system which collapsed two screens into one and then went back to two.
Comment 14 tbrunhoff 2016-09-24 13:49:03 UTC
Created attachment 162198 [details]
stacktrace

Might be caused by this: both monitors were turned off for a few days, then possibly, when they were turned on, the X system reconfigured causing this exception.
Comment 15 javydreamercsw 2016-09-30 17:37:11 UTC
Created attachment 162292 [details]
stacktrace

Not sure what triggered it.
Comment 16 Exceptions Reporter 2016-10-18 13:17:33 UTC
This bug already has 600 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=193290
Comment 17 Karol Harezlak 2016-11-23 19:14:24 UTC
Created attachment 163010 [details]
stacktrace

Random error, not sure about the steps.
Comment 18 Exceptions Reporter 2017-01-17 09:11:40 UTC
This bug already has 650 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=193290
Comment 19 stiemannkj1 2017-03-07 17:06:50 UTC
Martin Balin's workaround fixes this: include -J-Dsun.java2d.xrender=false in your $NETBEANS_HOME/etc/netbeans.conf as part of the netbeans_default_options and this exception won't occur.
Comment 20 ytn01 2017-03-10 19:15:32 UTC
Created attachment 163814 [details]
stacktrace

Installed a fresh copy of NetBeans (java version) to a newly created Ubuntu 16 Virtual machine.
The vm has open jdk-8-121 installed.
After launching NetBeans for the very first time, ... the exception occured.
Comment 21 Tomas Hurka 2017-03-22 09:10:19 UTC
The bug is caused by error in JDK, not in NetBeans. It happens when displays are changed. The JDK bug is fixed in JDK 8 Update 112/121.

Closing.
Comment 22 tbrunhoff 2017-04-15 16:42:39 UTC
jdk-8u121-linux-x64.rpm fixes it. Thanks.
Comment 23 wwarlock 2017-08-16 15:19:11 UTC
Created attachment 164963 [details]
Stacktrace of the error

The same error on the Java build 1.8.0_141-b15
Comment 24 wwarlock 2017-08-16 17:43:29 UTC
(In reply to wwarlock from comment #23)
> Created attachment 164963 [details]
> Stacktrace of the error
> 
> The same error on the Java build 1.8.0_141-b15

I'm very sorry.
I was wrong, I saw this error on 8u121.
Comment 25 bismuth 2017-09-27 19:44:39 UTC
As per the stackoverflow answer linked earlier (https://stackoverflow.com/a/38038737/7531) this is a JDK bug. However, it is not resolved in JDK 8 Update 121.

The bug involved is this one: https://bugs.openjdk.java.net/browse/JDK-8147542
and that has been resolved in JDK 9 build 131.

There was a backport to 8, but that was for some reason withdrawn: https://bugs.openjdk.java.net/browse/JDK-8170986

I'm still getting this error on JDK 8 build 141-b15.