On Wed, 09 Oct 2002 06:59:27 -0400, Sabrina L Landis wrote: > Hi, > I am working on a project that requires simple query list screens to be > exported to Excel. The spreadsheet format is very simple, and I've been > able to generate the file with no problem using a standalone Java class. > > However, when I try to generate the same file using a servlet or JSP > within our application, I get error messages. The serlvet produces the > error message "java.lang.IllegalAccessError: try to access class > org.apache.poi.poifs.storage.BigBlock from class > org.apache.poi.poifs.filesystem.POIFSDocument$BigBlockStore". The JSP > produces the error message "?CAL4MX9N.xls? cannot be accessed. The file > may be read-only, or you may be trying to access a read-only location. > Or, the server the document is stored on may note be responding." > > I put in a bunch of debug statements and found out that the program runs > fine up to the point where it calls the HSSFWorkbook.write method to > output the file. We think it may be a problem with the code trying to > write to a restricted area of our file system. I am using the POI 1.5 > final release (HSSF usermodel API), JDK 1.3.1_04, my application server > is Oracle 9ias (OC4J), and I've tried to run the code on both NT and > Unix boxes. Any advice on how to resolve this problem would be greatly > appreciated. > >
Just a couple of suggestions. By itself HSSFWorkbook writes to a stream. So if the stream is pointing to a restricted area of your filesystem...you did it. You need to supply a stack trace, perhaps a JSP with the minimum amount of code necessary to replicate the problem (maybe a "Hello World" spreadsheet). I'm not sure whether IllegalAccessError refers to POIFS trying to read your input stream or some temp file written in your "work" directory by your app server. (which would probably mean someone has tweaked the permissions incorrectly). Lastly, please upgrade to 1.5.1 as it contains bugfixes to 1.5.0 (none of which have anything to do with the problem you're having, but certainly might help with any future issues you may encounter). Thanks, Andy > Regards, > Sabrina -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
