Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
BIRT DiskCache error with custom objects
jboydnolan
All,
I have a report that is structured using a script dataset as its data source. In addition to the standard data primitives (string, integer, boolean, etc), there are fields in the dataset holding java objects like hashtables and other custom classes. This works great for the full report, UNTIL the report size gets big enough that BIRT needs to cache it to disk during generation. When that happens, the report fails with an NPE in org.eclipse.birt.data.engine.olap.data.util.ObjectWriter. The root cause is that BIRT does not recognize any of the non-primitive data types and fails.
Does anyone have any guidance on dealing with these custom data types appropriately? Are there certain interfaces that must be implemented to allow BIRT to cache them?
This seems like a common situation, so I am hoping that some of you can provide some wisdom on how to handle it. Thanks in advance for your help!
Boyd
Find more posts tagged with
Comments
CBR
Do your objects implement the Serializable interface?
jboydnolan
The top level class contained in the Hash does, but I also need to look through all the contained objects to see if the do also. I think I may back off as a test and replace the class instance in the Hash Map with something basic like a string and see if the exception goes away...at least that would confirm that the issue is inside the construction of my class.
Boyd
CBR
That's a good idea. Let me know if this fixed the issue.
jboydnolan
Unfortunately it did not. I'm likely not understanding how this is supposed to work, but I don't see how the serialization settings on the class would allow this particular part of the code in the disk caching to work. ObjectWriter.write calls IOUtil.getRandomWriter, which only recognizes these data types:
case DataType.BOOLEAN_TYPE :
case DataType.INTEGER_TYPE :
case DataType.BYTES_TYPE:
case DataType.DOUBLE_TYPE :
case DataType.STRING_TYPE :
case DataType.DATE_TYPE :
case DataType.BLOB_TYPE :
case DataType.BIGDECIMAL_TYPE :
case DataType.SQL_DATE_TYPE :
case DataType.SQL_TIME_TYPE :
When anything outside of these datatypes is passed in (in particular the data type unknown, -1, value), a null is returned for the writer, which then triggers the NPE when this statement is called in ObjectWriter.write:
writer.write( file, obj );
I don't see how this part of the disk caching logic could ever work with data types outside the list shown above. This is all coming from the StructureDiskArray class when it persists the cachedobjects.
I'm hoping there is something obvious I am missing...is this a limitation in BIRT, or am I missing something really obvious? Any idea?
Boyd