2002 JI Open Discussion Posted August 18, 2006 Share Posted August 18, 2006 By: Gary Hill - gary_hill94 NegativeArraySizeException 2003-08-25 19:19 I am displaying an image on a report that is passed to the report as a report parameter. If I load a JPEG from a file and create an Image with the ToolKit everything works fine. If I pull the JPEG from a database BLOB then create an Image with the ToolKit I get a NegativeArraySizeException from DataBufferInt. Four lines into the stack trace it lists the JRImageLoader. I have a JOptionPane displaying the Image that is passed to the report. The JOptionPane has no problems with either Image. Any ideas? I'm using JDK 1.3 and JasperReports 0.4.4. By: Gary Hill - gary_hill94 RE: NegativeArraySizeException 2003-09-03 10:22 Perhaps my problem statement was not clear. Here it is again. 1. Create a java.lang.Image from a JPEG file on disk. 2. Display the Image on a JOptionPane. 3. Pass the Image to my report as a report parameter. 4. View the report. The process described above works fine. 1. Create a java.lang.Image from a database BLOb. (The BLOb contains the same image as the JPEG file.) 2. Display the Image on a JOptionPane. 3. Pass the Image to my report as a report parameter. 4. View the report. This process fails with a NegativeArraySizeException. I believe the Image created from the database BLOb is okay because it displays on the JOptionPane properly, but JasperReports dies when I try to use it. To keep this posting short and readable I have not posted my source code or the text of the error trace. I can post it if needed. Has anyone out there displayed an Image on a report that is extracted from a database BLOb? Thank you for any assistance you can provide. Gary By: Gary Hill - gary_hill94 RE: NegativeArraySizeException 2003-09-22 12:36 Problem solved. I had to use MediaTracker to be sure the image was fully loaded from the database before it was passed to my report. (Something I had already tried but must have done incorrectly.) I still cannot explain why the JOptionPane had no difficulty displaying the same image without using MediaTracker. Must have something to do with timing. Gary Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now