BIRT Exchange Forum: BIRT DiskCache error with custom objects - BIRT Exchange Forum

Jump to content


 

BIRT Poll: To best make a table fill a pdf page before breaking (PL=page layout, PBI=page break interval) set:

PL: auto, PBI: 0PL: fixed, PBI: 0PL: auto, PBI: 1000000PL: fixed, PBI: 1000000
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

BIRT DiskCache error with custom objects Rate Topic: -----

#1 User is offline   jboydnolan Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 7
  • Joined: 06-June 12


Posted 07 June 2012 - 02:06 PM

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
0

#2 User is offline   cbrell Icon

  • Member
  • Group: Members
  • Posts: 523
  • Joined: 17-March 09


Posted 08 June 2012 - 10:10 AM

Do your objects implement the Serializable interface?
Interested to join BIRT User Group Mannheim (Germany)?
Have a look at: http://www.xing.com/...-group-mannheim or write me an email
0

#3 User is offline   jboydnolan Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 7
  • Joined: 06-June 12


Posted 11 June 2012 - 06:18 AM

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
0

#4 User is offline   cbrell Icon

  • Member
  • Group: Members
  • Posts: 523
  • Joined: 17-March 09


Posted 11 June 2012 - 10:07 PM

That's a good idea. Let me know if this fixed the issue.
Interested to join BIRT User Group Mannheim (Germany)?
Have a look at: http://www.xing.com/...-group-mannheim or write me an email
0

#5 User is offline   jboydnolan Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 7
  • Joined: 06-June 12


Posted 12 June 2012 - 04:43 AM

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
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users