Bug 57429 - Calling WorkbookFactory.create on App engine failed because of SecurityManager is a restricted class
Summary: Calling WorkbookFactory.create on App engine failed because of SecurityManage...
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: 3.11-FINAL
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-09 08:29 UTC by lamerepalermo
Modified: 2015-01-09 09:26 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lamerepalermo 2015-01-09 08:29:12 UTC
I just encountered an issue while trying to read xls file on app engine with the latest version of POI (3.11). As mentioned in the subject, while calling workbookFactory.create, it ended up to use the SecurityManager that is a restricted class in app engine.

After I dig into the recent changes, I found that it is coming from the following commit:

http://mail-archives.apache.org/mod_mbox/poi-commits/201408.mbox/%3C20140804181727.48FA02388F61@eris.apache.org%3E

After I downgrade the library to the version 3.8, I do not have the issue anymore.

Here is the stacktrace of my issue :

java.lang.NoClassDefFoundError: com.sun.org.apache.xerces.internal.util.SecurityManager is a restricted class. Please see the Google App Engine developer's guide for more details.
    at com.google.apphosting.runtime.security.shared.stub.com.sun.org.apache.xerces.internal.util.SecurityManager.<clinit>(SecurityManager.java)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at java.lang.Class.newInstance(Class.java:370)
    at org.apache.poi.util.DocumentHelper.trySetXercesSecurityManager(DocumentHelper.java:77)
    at org.apache.poi.util.DocumentHelper.<clinit>(DocumentHelper.java:57)
    at org.apache.poi.openxml4j.opc.internal.ContentTypeManager.parseContentTypesFile(ContentTypeManager.java:376)
    at org.apache.poi.openxml4j.opc.internal.ContentTypeManager.<init>(ContentTypeManager.java:102)
    at org.apache.poi.openxml4j.opc.internal.ZipContentTypeManager.<init>(ZipContentTypeManager.java:54)
    at org.apache.poi.openxml4j.opc.ZipPackage.getPartsImpl(ZipPackage.java:192)
    at org.apache.poi.openxml4j.opc.OPCPackage.getParts(OPCPackage.java:673)
    at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:274)
    at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:87)
Comment 1 Dominik Stadler 2015-01-09 09:26:51 UTC
This should be fixed by r1650290 on trunk, can you try a nightly build from https://builds.apache.org/job/POI/lastSuccessfulBuild/artifact/build/dist/ and reopen this bug if it still does not work?