views:

96

answers:

2

I have a few JasperReports made and running very fine on a Windows machine. The problem started when the reports were set to run on a mainframe with zOS operating system.

The problem is: when Jasper creates the report it seems to read the tables metadata from the database and based on it expect the data to come.
Example: if i have a column of type varchar(20), then Jasper will be waiting for 20 chars only even if the report field is defined as String.

That doesn't happen in Windows environment, but on the mainframe the character-encoding is EBCDIC, and so the column might have 19 chars on the mainframe, but when encoded its returned to the report as 23 or 24 characters.

Note: this problem only occurs in non-English characters.

UPDATE
A ConversionBufferFull is thrown when Jasper is creating the report, i don't have the full trace since i can't access the mainframe log. The problem occurs with only one column called COUNTRY_DESC when the value is around 17-20 chars, the exception occurs.

As i mentioned the character set on the mainframe is EBCDIC, but when its read through the JDBC its converted to Unicode. for example in EBCDIC the word will be 17 chars, but when converted it become 22. For some strange reason Jasper expects 20 for this field only.

+1  A: 

sun.io.ConversionBufferFullException is thrown by sun.io character encoding converters and may bubble up through java.io classes in older versions of Java. This API has been deprecated for some time and is no longer in use since Java 6 - java.nio.charset is used instead.

It is a character conversion bug in either JasperReports, your JDBC driver or things used by those two. I don't think it has anything to do with reading meta-data from the JDBC ResultSet per se, although it might be the strings in the meta-data that is incorrectly converted.

It's hard to place the blame or think up a work-around without the stack trace.

Christian Vest Hansen
I added the update note, its not truncated, and it has nothing to do with how the field is represented in the report. Before filing the bug, i want to make sure, does it really read the column length and expect data based on that?
medopal
+1  A: 

JasperReports itself does not manage the data conversion, nor the field length. This looks like an issue with the JDBC driver.

Sherman Jaspersoft

Sherman Wood
oh we have someone from JasperSoft, great. ok thanks, will look further in that direction. I believe the JDBC driver for the mainframe zOS is a little old, that should be a good starting point, thanks.
medopal