Closed comp500 closed 5 years ago
On AdoptOpenJDK 8 (OpenJ9) on 1.14.4 Fabric, I get a different but still strange error, and the screenshot still copies!
javax.imageio.IIOException: Invalid argument to native writeImage
at com.sun.imageio.plugins.jpeg.JPEGImageWriter.writeImage(Native Method)
at com.sun.imageio.plugins.jpeg.JPEGImageWriter.writeOnThread(JPEGImageWriter.java:1067)
at com.sun.imageio.plugins.jpeg.JPEGImageWriter.write(JPEGImageWriter.java:363)
at javax.imageio.ImageWriter.write(ImageWriter.java:615)
at sun.awt.datatransfer.DataTransferer.imageToStandardBytesImpl(DataTransferer.java:2215)
at sun.awt.datatransfer.DataTransferer.imageToStandardBytes(DataTransferer.java:2145)
at sun.awt.windows.WDataTransferer.imageToPlatformBytes(WDataTransferer.java:352)
at sun.awt.datatransfer.DataTransferer.translateTransferable(DataTransferer.java:1223)
at sun.awt.windows.WDataTransferer.translateTransferable(WDataTransferer.java:219)
at sun.awt.windows.WClipboard.setContentsNative(WClipboard.java:83)
at sun.awt.datatransfer.SunClipboard.setContents(SunClipboard.java:106)
at link.infra.screenshotclipboard.ScreenshotToClipboard.lambda$doCopy$0(ScreenshotToClipboard.java:107)
at link.infra.screenshotclipboard.ScreenshotToClipboard$$Lambda$3102.00000000135A1550.run(Unknown Source)
at java.lang.Thread.run(Thread.java:819)
Similar error in Forge 1.14.4-28.1.1 produced on AdoptOpenJDK Hotspot 1.8.0_222
[13Sep2019 12:39:01.712] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]: javax.imageio.IIOException: Invalid argument to native writeImage
[13Sep2019 12:39:01.712] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]: at com.sun.imageio.plugins.jpeg.JPEGImageWriter.writeImage(Native Method)
[13Sep2019 12:39:01.712] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]: at com.sun.imageio.plugins.jpeg.JPEGImageWriter.writeOnThread(JPEGImageWriter.java:1067)
[13Sep2019 12:39:01.712] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]: at com.sun.imageio.plugins.jpeg.JPEGImageWriter.write(JPEGImageWriter.java:363)
[13Sep2019 12:39:01.712] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]: at javax.imageio.ImageWriter.write(ImageWriter.java:615)
[13Sep2019 12:39:01.712] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]: at sun.awt.datatransfer.DataTransferer.imageToStandardBytesImpl(DataTransferer.java:2215)
[13Sep2019 12:39:01.712] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]: at sun.awt.datatransfer.DataTransferer.imageToStandardBytes(DataTransferer.java:2145)
[13Sep2019 12:39:01.712] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]: at sun.awt.windows.WDataTransferer.imageToPlatformBytes(WDataTransferer.java:352)
[13Sep2019 12:39:01.712] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]: at sun.awt.datatransfer.DataTransferer.translateTransferable(DataTransferer.java:1223)
[13Sep2019 12:39:01.713] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]: at sun.awt.windows.WDataTransferer.translateTransferable(WDataTransferer.java:219)
[13Sep2019 12:39:01.713] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]: at sun.awt.windows.WClipboard.setContentsNative(WClipboard.java:83)
[13Sep2019 12:39:01.713] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]: at sun.awt.datatransfer.SunClipboard.setContents(SunClipboard.java:106)
[13Sep2019 12:39:01.713] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]: at link.infra.screenshotclipboard.ScreenshotToClipboard.lambda$doCopy$2(ScreenshotToClipboard.java:133)
[13Sep2019 12:39:01.713] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]: at java.lang.Thread.run(Thread.java:748)
Forge 1.14.x doesn't support OpenJ9.
Fixing #5 should fix this.
I'm chasing a similar bug in my Java app. This article seems to explain the issue: http://www.jfree.org/forum/viewtopic.php?t=120416
Thanks, I'll take a look.
Log: https://paste.ee/p/GO6HK
Very funky indeed, but the screenshot still captures! I don't think it's really an issue that can cause problems (for now, at least), but I've made this issue in case it causes problems later and/or anyone else finds this.