You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by James Allchin <ja...@knowledgemill.com> on 2009/08/28 16:01:11 UTC
org.apache.poi.hsmf.MAPIMessage - can not process certain MSG
messages
Hi,
I am testing POI for parsing the text out of Microsoft MSG files.
I have noticed two consistent issues whilst processing a set of test emails (8 failures out of 8500 test files).
The first relates to "java.lang.IndexOutOfBoundsException at org.apache.poi.util.IntList.get"
The second relates to "java.io.IOException: Cannot remove block [XXX] at at org.apache.poi.poifs.storage.BlockListImpl.remove(BlockListImpl.java:114)"
I have the following test class in order to replicate the problems:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package test;
import java.io.*;
import java.util.ArrayList;
import org.apache.poi.hsmf.MAPIMessage;
/**
*
* @author km
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws Exception {
MAPIMessage mm = null;
ArrayList<String> filenames = new ArrayList<String>();
ArrayList<Exception> exceptions = new ArrayList<Exception>();
filenames.add("/tmp/testfiles/12389.dat");
filenames.add("/tmp/testfiles/14295.dat");
filenames.add("/tmp/testfiles/16778.dat");
filenames.add("/tmp/testfiles/17254.dat");
filenames.add("/tmp/testfiles/4444.dat");
filenames.add("/tmp/testfiles/5261.dat");
filenames.add("/tmp/testfiles/5262.dat");
filenames.add("/tmp/testfiles/5735.dat");
System.out.println ("Attempting to process test files");
System.out.println ("---------------------------------");
for (int i = 0; i < filenames.size(); i++) {
try {
mm = new MAPIMessage(filenames.get(i));
System.out.println("Subject is " + mm.getSubject());
}
catch (Exception e) {
exceptions.add(e);
}
}
System.out.println ("Printing exceptions");
System.out.println ("---------------------------------");
for (int i = 0; i < exceptions.size(); i++) {
exceptions.get(i).printStackTrace();
}
}
}
Can someone advise where I can send the test emails to? I am not sure I can attach them when sending to the distribution list.
Many thanks,
James
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org