com.atlassian.jira.issue.attachment.AttachmentReadException: java.lang.NegativeArraySizeException

Atlassian JIRA | Woo Yit Wei [Atlassian] | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Unable to View Issue in JIRA after Attaching a PNG File - Atlassian Documentation

    atlassian.com | 10 months ago
    com.atlassian.jira.issue.attachment.AttachmentReadException: java.lang.NegativeArraySizeException
  2. 0

    h3. Summary After attaching *certain* png images to an issue, the issue will no longer be accessible. The page will just load continuously with {{Java Heap Space}} being thrown in the logs h3. Environment * JIRA 6.4.x * Java7 h3. Steps to Reproduce # Install JIRA 6.4.x while using Java7 # Create a project with several issues # Attempt to attach the affected image to an issue #* After attaching an image to a JIRA issue, the image doesn't seem to be successfully attached. It will just be stuck in the following screenshot !stuck.png|thumbnail! # Click *Cancel* or refresh the page h3. Expected Results # The image is attached without any problems # Refreshing the page will load the issue as per normal h3. Actual Results # Image is attached to the issue but a thumbnail will fail to be generates The below exception is thrown in the atlassian-jira.log file: {noformat}2015-07-22 15:33:55,179 file-attachment-store:thread-2 ERROR admin 933x119x2 1t0ctls 0:0:0:0:0:0:0:1 /plugins/servlet/streams [core.util.thumbnail.Thumber] Unable to create thumbnail image for id 11817 javax.imageio.IIOException: Error reading PNG metadata at com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:769) at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1229) at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1577) at com.atlassian.core.util.thumbnail.Thumber.scaleImage(Thumber.java:231) at com.atlassian.core.util.thumbnail.Thumber.createThumbnail(Thumber.java:291) at com.atlassian.core.util.thumbnail.Thumber.retrieveOrCreateThumbNail(Thumber.java:270) at com.atlassian.jira.issue.thumbnail.DefaultThumbnailManager$3.withInputStream(DefaultThumbnailManager.java:252) at com.atlassian.jira.issue.thumbnail.DefaultThumbnailManager$3.withInputStream(DefaultThumbnailManager.java:248) at com.atlassian.jira.issue.managers.DefaultAttachmentManager$8.get(DefaultAttachmentManager.java:874) at com.atlassian.jira.issue.managers.DefaultAttachmentManager$8.get(DefaultAttachmentManager.java:868) at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$2.get(DefaultFileSystemAttachmentStore.java:145) at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$2.get(DefaultFileSystemAttachmentStore.java:141) at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$3.call(DefaultFileSystemAttachmentStore.java:178) at com.atlassian.util.concurrent.Executors$DefaultSubmitter$CallableRunner.run(Executors.java:62) at com.atlassian.util.concurrent.LimitedExecutor$Runner.run(LimitedExecutor.java:93) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.io.EOFException at javax.imageio.stream.ImageInputStreamImpl.readFully(ImageInputStreamImpl.java:353) at javax.imageio.stream.ImageInputStreamImpl.readFully(ImageInputStreamImpl.java:361) at com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:746) ... 17 more 2015-07-22 15:33:55,205 http-bio-8080-exec-10 WARN admin 933x127x2 1t0ctls 0:0:0:0:0:0:0:1 /browse/USIM-103 [jira.issue.thumbnail.DefaultThumbnailManager] Error writing to thumbnail file: C:\Program Files\Atlassian\Application Data\JIRA6.4.4\data\attachments\USIM\USIM-103\thumbs\_thumb_11816.png7671839753314540877.tmp com.atlassian.jira.issue.attachment.AttachmentReadException: java.lang.NegativeArraySizeException at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$3.call(DefaultFileSystemAttachmentStore.java:182) at com.atlassian.util.concurrent.Executors$DefaultSubmitter$CallableRunner.run(Executors.java:62) at com.atlassian.util.concurrent.LimitedExecutor$Runner.run(LimitedExecutor.java:93) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NegativeArraySizeException at com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:745) at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1229) at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1577) at com.atlassian.core.util.thumbnail.Thumber.scaleIm age(Thumber.java:231) at com.atlassian.core.util.thumbnail.Thumber.createThumbnail(Thumber.java:291) at com.atlassian.jira.issue.thumbnail.DefaultThumbnailManager$3.withInputStream(DefaultThumbnailManager.java:252) at com.atlassian.jira.issue.thumbnail.DefaultThumbnailManager$3.withInputStream(DefaultThumbnailManager.java:248) at com.atlassian.jira.issue.managers.DefaultAttachmentManager$8.get(DefaultAttachmentManager.java:874) at com.atlassian.jira.issue.managers.DefaultAttachmentManager$8.get(DefaultAttachmentManager.java:868) at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$2.get(DefaultFileSystemAttachmentStore.java:145) at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$2.get(DefaultFileSystemAttachmentStore.java:141) at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$3.call(DefaultFileSystemAttachmentStore.java:178) ... 5 more{noformat} # When trying to view the issue again, the page will just load continuously. The following will be thrown in catalina.out {noformat}Exception in thread "file-attachment-store:thread-6" java.lang.OutOfMemoryError: Java heap space at com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:745) at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1229) at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1577) at com.atlassian.core.util.thumbnail.Thumber.scaleImage(Thumber.java:231) at com.atlassian.core.util.thumbnail.Thumber.createThumbnail(Thumber.java:291) at com.atlassian.core.util.thumbnail.Thumber.retrieveOrCreateThumbNail(Thumber.java:270) at com.atlassian.jira.issue.thumbnail.DefaultThumbnailManager$3.withInputStream(DefaultThumbnailManager.java:252) at com.atlassian.jira.issue.thumbnail.DefaultThumbnailManager$3.withInputStream(DefaultThumbnailManager.java:248) at com.atlassian.jira.issue.managers.DefaultAttachmentManager$8.get(DefaultAttachmentManager.java:874) at com.atlassian.jira.issue.managers.DefaultAttachmentManager$8.get(DefaultAttachmentManager.java:868) at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$2.get(DefaultFileSystemAttachmentStore.java:145) at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$2.get(DefaultFileSystemAttachmentStore.java:141) at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$3.call(DefaultFileSystemAttachmentStore.java:178) at com.atlassian.util.concurrent.Executors$DefaultSubmitter$CallableRunner.run(Executors.java:62) at com.atlassian.util.concurrent.LimitedExecutor$Runner.run(LimitedExecutor.java:93) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Exception in thread "file-attachment-store:thread-7" java.lang.OutOfMemoryError: Java heap space Exception in thread "file-attachment-store:thread-8" java.lang.OutOfMemoryError: Java heap space Exception in thread "file-attachment-store:thread-10" java.lang.OutOfMemoryError: Java heap space Exception in thread "file-attachment-store:thread-11" java.lang.OutOfMemoryError: Java heap space Exception in thread "file-attachment-store:thread-12" java.lang.OutOfMemoryError: Java heap space Exception in thread "file-attachment-store:thread-13" java.lang.OutOfMemoryError: Java heap space{noformat} h3. Notes # Seems to be related to Java version #* After updating Java to version 8, the issue can be viewed but the thumbnail is still not generated # Problem does *not* happen with JIRA 6.3.15 (Java7) # Since JIRA 6.4 supports both Java 7 & 8, JIRA shouldn't be affected by this when Java 7 is used h3.Workaround # Manually generate the thumbnail for this image (instructions found [here|https://confluence.atlassian.com/display/JIRAKB/Unable+to+View+Issue+in+JIRA+after+Attaching+a+PNG+File]); OR # Upgrade your JAVA version to 1.8.0_05 and above

    Atlassian JIRA | 2 years ago | Woo Yit Wei [Atlassian]
    com.atlassian.jira.issue.attachment.AttachmentReadException: java.lang.NegativeArraySizeException
  3. 0

    h3. Summary After attaching *certain* png images to an issue, the issue will no longer be accessible. The page will just load continuously with {{Java Heap Space}} being thrown in the logs h3. Environment * JIRA 6.4.x * Java7 h3. Steps to Reproduce # Install JIRA 6.4.x while using Java7 # Create a project with several issues # Attempt to attach the affected image to an issue #* After attaching an image to a JIRA issue, the image doesn't seem to be successfully attached. It will just be stuck in the following screenshot !stuck.png|thumbnail! # Click *Cancel* or refresh the page h3. Expected Results # The image is attached without any problems # Refreshing the page will load the issue as per normal h3. Actual Results # Image is attached to the issue but a thumbnail will fail to be generates The below exception is thrown in the atlassian-jira.log file: {noformat}2015-07-22 15:33:55,179 file-attachment-store:thread-2 ERROR admin 933x119x2 1t0ctls 0:0:0:0:0:0:0:1 /plugins/servlet/streams [core.util.thumbnail.Thumber] Unable to create thumbnail image for id 11817 javax.imageio.IIOException: Error reading PNG metadata at com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:769) at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1229) at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1577) at com.atlassian.core.util.thumbnail.Thumber.scaleImage(Thumber.java:231) at com.atlassian.core.util.thumbnail.Thumber.createThumbnail(Thumber.java:291) at com.atlassian.core.util.thumbnail.Thumber.retrieveOrCreateThumbNail(Thumber.java:270) at com.atlassian.jira.issue.thumbnail.DefaultThumbnailManager$3.withInputStream(DefaultThumbnailManager.java:252) at com.atlassian.jira.issue.thumbnail.DefaultThumbnailManager$3.withInputStream(DefaultThumbnailManager.java:248) at com.atlassian.jira.issue.managers.DefaultAttachmentManager$8.get(DefaultAttachmentManager.java:874) at com.atlassian.jira.issue.managers.DefaultAttachmentManager$8.get(DefaultAttachmentManager.java:868) at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$2.get(DefaultFileSystemAttachmentStore.java:145) at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$2.get(DefaultFileSystemAttachmentStore.java:141) at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$3.call(DefaultFileSystemAttachmentStore.java:178) at com.atlassian.util.concurrent.Executors$DefaultSubmitter$CallableRunner.run(Executors.java:62) at com.atlassian.util.concurrent.LimitedExecutor$Runner.run(LimitedExecutor.java:93) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.io.EOFException at javax.imageio.stream.ImageInputStreamImpl.readFully(ImageInputStreamImpl.java:353) at javax.imageio.stream.ImageInputStreamImpl.readFully(ImageInputStreamImpl.java:361) at com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:746) ... 17 more 2015-07-22 15:33:55,205 http-bio-8080-exec-10 WARN admin 933x127x2 1t0ctls 0:0:0:0:0:0:0:1 /browse/USIM-103 [jira.issue.thumbnail.DefaultThumbnailManager] Error writing to thumbnail file: C:\Program Files\Atlassian\Application Data\JIRA6.4.4\data\attachments\USIM\USIM-103\thumbs\_thumb_11816.png7671839753314540877.tmp com.atlassian.jira.issue.attachment.AttachmentReadException: java.lang.NegativeArraySizeException at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$3.call(DefaultFileSystemAttachmentStore.java:182) at com.atlassian.util.concurrent.Executors$DefaultSubmitter$CallableRunner.run(Executors.java:62) at com.atlassian.util.concurrent.LimitedExecutor$Runner.run(LimitedExecutor.java:93) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NegativeArraySizeException at com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:745) at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1229) at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1577) at com.atlassian.core.util.thumbnail.Thumber.scaleIm age(Thumber.java:231) at com.atlassian.core.util.thumbnail.Thumber.createThumbnail(Thumber.java:291) at com.atlassian.jira.issue.thumbnail.DefaultThumbnailManager$3.withInputStream(DefaultThumbnailManager.java:252) at com.atlassian.jira.issue.thumbnail.DefaultThumbnailManager$3.withInputStream(DefaultThumbnailManager.java:248) at com.atlassian.jira.issue.managers.DefaultAttachmentManager$8.get(DefaultAttachmentManager.java:874) at com.atlassian.jira.issue.managers.DefaultAttachmentManager$8.get(DefaultAttachmentManager.java:868) at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$2.get(DefaultFileSystemAttachmentStore.java:145) at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$2.get(DefaultFileSystemAttachmentStore.java:141) at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$3.call(DefaultFileSystemAttachmentStore.java:178) ... 5 more{noformat} # When trying to view the issue again, the page will just load continuously. The following will be thrown in catalina.out {noformat}Exception in thread "file-attachment-store:thread-6" java.lang.OutOfMemoryError: Java heap space at com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:745) at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1229) at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1577) at com.atlassian.core.util.thumbnail.Thumber.scaleImage(Thumber.java:231) at com.atlassian.core.util.thumbnail.Thumber.createThumbnail(Thumber.java:291) at com.atlassian.core.util.thumbnail.Thumber.retrieveOrCreateThumbNail(Thumber.java:270) at com.atlassian.jira.issue.thumbnail.DefaultThumbnailManager$3.withInputStream(DefaultThumbnailManager.java:252) at com.atlassian.jira.issue.thumbnail.DefaultThumbnailManager$3.withInputStream(DefaultThumbnailManager.java:248) at com.atlassian.jira.issue.managers.DefaultAttachmentManager$8.get(DefaultAttachmentManager.java:874) at com.atlassian.jira.issue.managers.DefaultAttachmentManager$8.get(DefaultAttachmentManager.java:868) at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$2.get(DefaultFileSystemAttachmentStore.java:145) at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$2.get(DefaultFileSystemAttachmentStore.java:141) at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$3.call(DefaultFileSystemAttachmentStore.java:178) at com.atlassian.util.concurrent.Executors$DefaultSubmitter$CallableRunner.run(Executors.java:62) at com.atlassian.util.concurrent.LimitedExecutor$Runner.run(LimitedExecutor.java:93) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Exception in thread "file-attachment-store:thread-7" java.lang.OutOfMemoryError: Java heap space Exception in thread "file-attachment-store:thread-8" java.lang.OutOfMemoryError: Java heap space Exception in thread "file-attachment-store:thread-10" java.lang.OutOfMemoryError: Java heap space Exception in thread "file-attachment-store:thread-11" java.lang.OutOfMemoryError: Java heap space Exception in thread "file-attachment-store:thread-12" java.lang.OutOfMemoryError: Java heap space Exception in thread "file-attachment-store:thread-13" java.lang.OutOfMemoryError: Java heap space{noformat} h3. Notes # Seems to be related to Java version #* After updating Java to version 8, the issue can be viewed but the thumbnail is still not generated # Problem does *not* happen with JIRA 6.3.15 (Java7) # Since JIRA 6.4 supports both Java 7 & 8, JIRA shouldn't be affected by this when Java 7 is used h3.Workaround # Manually generate the thumbnail for this image (instructions found [here|https://confluence.atlassian.com/display/JIRAKB/Unable+to+View+Issue+in+JIRA+after+Attaching+a+PNG+File]); OR # Upgrade your JAVA version to 1.8.0_05 and above

    Atlassian JIRA | 2 years ago | Woo Yit Wei [Atlassian]
    com.atlassian.jira.issue.attachment.AttachmentReadException: java.lang.NegativeArraySizeException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NegativeArraySizeException

      No message provided

      at com.sun.imageio.plugins.png.PNGImageReader.readMetadata()
    2. Java RT
      PNGImageReader.read
      1. com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:745)
      2. com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1229)
      3. com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1577)
      3 frames