https://bz.apache.org/bugzilla/show_bug.cgi?id=61004
Bug ID: 61004
Summary: org.apache.poi.hssf.usermodel.HSSFWorkbook.createCellS
tyle() throws NoClassDefFoundError on Google App
Engine
Product: POI
Version: 3.16-dev
Hardware: Other
OS: other
Status: NEW
Severity: normal
Priority: P2
Component: HSSF
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Created attachment 34925
--> https://bz.apache.org/bugzilla/attachment.cgi?id=34925&action=edit
Excel file generated from POI APIs
The following code example works fine with poi-3.15-20160924.jar on Google App
Engine environment:
private static CellStyle newCellStyle( Workbook oWorkbook )
{
CellStyle oCellStyle = oWorkbook.createCellStyle();
oCellStyle.setBorderBottom(BorderStyle.THIN);
oCellStyle.setBorderTop(BorderStyle.THIN);
oCellStyle.setBorderLeft(BorderStyle.THIN);
oCellStyle.setBorderRight(BorderStyle.THIN);
oCellStyle.setAlignment(HorizontalAlignment.CENTER);
oCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
oCellStyle.setWrapText(true);
return oCellStyle;
}
The same code throws java.lang.NoClassDefFoundError error with latest
poi-3.16-20170419.jar:
Error for /betacapm
java.lang.NoClassDefFoundError: java.awt.Color is a restricted class. Please
see the Google App Engine developer's guide for more details.
at
com.google.apphosting.runtime.security.shared.stub.java.awt.Color.<clinit>(Color.java)
at
org.apache.poi.hssf.util.HSSFColor$HSSFColorPredefined.<init>(HSSFColor.java:113)
at
org.apache.poi.hssf.util.HSSFColor$HSSFColorPredefined.<clinit>(HSSFColor.java:55)
at
org.apache.poi.hssf.model.InternalWorkbook.createExtendedFormat(InternalWorkbook.java:1450)
at
org.apache.poi.hssf.model.InternalWorkbook.createCellXF(InternalWorkbook.java:921)
at
org.apache.poi.hssf.usermodel.HSSFWorkbook.createCellStyle(HSSFWorkbook.java:1326)
at
org.apache.poi.hssf.usermodel.HSSFWorkbook.createCellStyle(HSSFWorkbook.java:123)
at com.betacapm.api.PortfolioWorkbook.newCellStyle(PortfolioWorkbook.java:163)
My use case is to create an Excel spreadsheet. As mentioned before, this use
case works with POI v3.15 in the Google App Engine environment, but breaks with
v3.16.
I had encountered a similar issue when I migrated from v3.13 to v3.14. See bug
https://bz.apache.org/bugzilla/show_bug.cgi?id=59194 for details. This was
fixed in v3.15.
There are no Jetty jars in my GAE setup. Outside of the default GAE jars, this
is what I package into my app:
commons-codec-1.10.jar
commons-lang3-3.5.jar
commons-logging-1.2.jar
commons-math3-3.6.1.jar
gson-2.8.0.jar
Currently, my only workaround is to revert to v3.15.
Attachment Stocks.xls shows a sample Excel fie created with POI apis.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]