I'm trying to read an xlsx file with Apache Poi. Program works but when I tr

I'm trying to read an xlsx file with Apache Poi. Program works but when I try to put it in a smart service, I get an error java.lang.reflect.InvocationTargetException

after line XSSFWorkbook
File file = new File(fileName);
OPCPackage opcPackage = OPCPackage.open(file);
XSSFWorkbook myWorkbook = new XSSFWorkbook(opcPackage);

I wonder if the error would come from user's rights as the error seems to be at createDocumentPart. I'm using Appain 7 on Windows server 2008. With which account does run a smart service ? Where is it's temp folder ?

Thanks,

Olivier

ERROR com.appiancorp.process.engine.UnattendedJavaActivityRequest - An error occurred while executing activity: id=536883553, classname=com.solypse.etde.SolImportExcel
org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException
          at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:62)
          at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPa...

OriginalPostID-58453

OriginalPostID-58453

  Discussion posts and replies are publicly visible

Parents
  • I tried to add main to run program outside Appian. It runs in Eclipse but when launched as smart, the following code exist with "error 0 Can't read content types part !".and no message in appian-server.log. Of course, I tried to open the Excel file from another pc, tried another file, same problem.

    Thanks for any help, I'm struggling with this for two days now.

              fileName="C:\\\\1_Solypse\\\          est2.xlsx";
              File file = new File(fileName);
                        OPCPackage opcPackage;
                        XSSFWorkbook myWorkbook = null;
                        try{
                                  opcPackage = OPCPackage.open(file);
                                  myWorkbook=new XSSFWorkbook(opcPackage);
                        } catch (Exception e){
                                  log("error 0 " + e.Message());
                        }

Reply
  • I tried to add main to run program outside Appian. It runs in Eclipse but when launched as smart, the following code exist with "error 0 Can't read content types part !".and no message in appian-server.log. Of course, I tried to open the Excel file from another pc, tried another file, same problem.

    Thanks for any help, I'm struggling with this for two days now.

              fileName="C:\\\\1_Solypse\\\          est2.xlsx";
              File file = new File(fileName);
                        OPCPackage opcPackage;
                        XSSFWorkbook myWorkbook = null;
                        try{
                                  opcPackage = OPCPackage.open(file);
                                  myWorkbook=new XSSFWorkbook(opcPackage);
                        } catch (Exception e){
                                  log("error 0 " + e.Message());
                        }

Children
No Data