I'm working on an export to XLS service using Apache POI 3.6, and I've
encountered a NoClassDefFoundError exception when using the autosize column
feature.
The code:
Sheet sheet = wb.createSheet("Viewpath Timesheet (date range)");
PrintSetup printSetup = sheet.getPrintSetup();
printSetup.setLandscape(true);
sheet.setFitToPage(true);
sheet.setHorizontallyCenter(true);
//Set first four columns width to autosize.
for (int i = 0; i <= 4; i++) {
sheet.autoSizeColumn(i); //Commenting this line out resolves the error.
}
Produces...
WARNING: /export/timesheet
javax.servlet.ServletException: java.lang.NoClassDefFoundError:
java.awt.font.FontRenderContext is a restricted class. Please see the Google
App Engine developer's guide for more details.
at
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:862)
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
at
org.apache.jsp.export.timesheet_jsp._jspService(timesheet_jsp.java:406)
...
Caused by: java.lang.NoClassDefFoundError: java.awt.font.FontRenderContext is a
restricted class. Please see the Google App Engine developer's guide for more
details.
at
com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:51)
at
org.apache.poi.hssf.usermodel.HSSFSheet.autoSizeColumn(HSSFSheet.java:1694)
at
org.apache.poi.hssf.usermodel.HSSFSheet.autoSizeColumn(HSSFSheet.java:1662)
at org.apache.jsp.export.timesheet_jsp.toXls(timesheet_jsp.java:154)
at
org.apache.jsp.export.timesheet_jsp._jspService(timesheet_jsp.java:396)
...Whaa..? Like a good baby-java dev, I checked the GAE developers guide as
directed, but couldn't find anything useful. I upgraded to POI 3.7 for kicks,
but the error remained. Anyone have experience with POI + Excel Spreadsheets +
GAE? Anyone? ...Bueller?
Cheers,
Matthew
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en.