Export DXL is failing

I am trying to export DXL of a NSF which is about 4.5GB in size. I am using the Java APIs with local lotus notes context and the following is the code snippet of the export functionality -

Stream stream = s.createStream();

if( stream == null ) {

 System.out.println("Error creating stream");

}

String dxlName = “sample.dxl”;

if (stream.open(dxlName))

{

stream.truncate();

    exporter = s.createDxlExporter();

    stream.writeText(exporter.exportDxl(db));

    exporter.recycle();

}

stream.close();

stream.recycle();

This code works fine for smaller NSFs and generates the DXL correctly.

However for a large NSF ~ 4GB or so it fails with the following error →

terminate called after throwing an instance of ‘unsigned short’

Stack base = 0xb7d7ac9c, Stack size = 1996 bytes

Fatal Error signal = 0x00000006 PID/TID = 6225/-1210594416

3/23/2010 11:36:40 Running NSD

You must be in the Notes/Domino data directory when you run this script

and you must have run Domino at least once

3/23/2010 11:36:41 Termination is in progress

3/23/2010 11:36:41 Terminating tasks

3/23/2010 11:36:46 Freeing resources

3/23/2010 11:36:46 Termination completed

Subject: Limitation of the Java DXL APIs

I think this is basically a limitation of the Java DXL APIs, though is should fail more gracefully.

In Java, the DxlExporter can only export to a string. It’s no surprise that something would blow up trying to write 4GB to a single string.

In LotusScript, the NotesDXLExporter can export directly to a stream. If it is feasible for you do change to LS, I’d suggest recoding it in LS and exporting directly to a stream. That, I would hope, would work correctly.