poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 53974] New: Can't create xls files in google app engine
Date Fri, 05 Oct 2012 16:47:37 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=53974

          Priority: P2
            Bug ID: 53974
          Assignee: dev@poi.apache.org
           Summary: Can't create xls files in google app engine
          Severity: normal
    Classification: Unclassified
                OS: Linux
          Reporter: fabien.sartor@gmail.com
          Hardware: PC
            Status: NEW
           Version: 3.8
         Component: HSSF
           Product: POI

The Apache POI 3.8 can't create xls files with google app engine.

Indeed, at the line 1098 of InternalWorkbook.java , POI uses
System.getProperty("user.name").
Usage of System.xxx is forbiden with app engine.

There is a usage of catch (AccessControlException e) { .. }.
You can add a new catch of NullPointerException like this :

--- InternalWorkbook.java.orig  2012-03-17 14:18:59.000000000 +0100
+++ InternalWorkbook.java.new   2012-10-05 18:17:25.000000000 +0200
@@ -1100,6 +1100,8 @@
                 // AccessControlException can occur in a restricted context
                 // (client applet/jws application or restricted security
server)
                 retval.setUsername("POI");
+        } catch (NullPointerException e) {
+            retval.setUsername("POI");
         }
         return retval;
     }

I try this fix and it works well.

Or you can modify the setUsername function in WriteAccessRecord.java (line 99).


PS: I don't use java.awt.x fonctionnalities.


My stack trace is : 

java.lang.NullPointerException
    at
org.apache.poi.hssf.record.WriteAccessRecord.setUsername(WriteAccessRecord.java:101)
    at
org.apache.poi.hssf.model.InternalWorkbook.createWriteAccess(InternalWorkbook.java:1098)
    at
org.apache.poi.hssf.model.InternalWorkbook.createWorkbook(InternalWorkbook.java:367)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:163)
    at
fsart.diffTools.outputDriver.Impl.CsvExcelView2SpecialAppEngine.<init>(CsvExcelView2SpecialAppEngine.scala:75)
    at fsart.diffTools.webApp.CompareFiles.doGet(CompareFiles.scala:68)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message