org.obiba.magma.MagmaRuntimeException: org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException

JIRA | 7 years ago
  1. 0

    Action: test OPAL-226 Step: ========= 1) create fresh databases 'opal' and 'key' for opal 1.0.1 2) issue an upgrade 3) import a zip file with 1 completed interview exported from onyx1.6.4 cohort ontario (please check the attachment in OPAL-226) 4) show variable table list 5) export tables one by one to an excel file based on the listed tables Result: ========= in step 4), the listed tables shown as follows: opal-keys opal-keys.keys opal-data-ohs opal-data-ohs.Participants opal-data-ohs.CIPreliminaryQuestionnaire opal-data-ohs.BloodSamplesCollection opal-data-ohs.HealthQuestionnaireNurse opal-data-ohs.Weight opal-data-ohs.BoneDensity opal-data-ohs.SalivaSamplesCollection opal-data-ohs.BloodPressure opal-data-ohs.ArmSpan opal-data-ohs.SittingHeight opal-data-ohs.GripStrength opal-data-ohs.AnkleBrachial opal-data-ohs.UrineSamplesCollection opal-data-ohs.HealthQuestionnaireTouchScreen opal-data-ohs.Impedance418 opal-data-ohs.ConclusionQuestionnaire opal-data-ohs.Instruments opal-data-ohs.Consent opal-data-ohs.StandingHeight opal-data-ohs.Hips opal-data-ohs.Spirometry opal-data-ohs.Waist opal-data-ohs.Workstations opal-data in step 5), there're two cases when exporting tables to xlsx file: ==>case a) able to export as many as required tables when tables have regular number of columns (not big number more than 256) to a single excel file for example, adm@opal>export -o a.xlsx opal-data-ohs.SalivaSamplesCollection adm@opal>export -o a.xlsx opal-data-ohs.BloodPressue adm@opal>export -o a.xlsx opal-data-ohs.ArmSpan adm@opal>export -o a.xlsx opal-data-ohs.SittingHeight adm@opal>export -o a.xlsx opal-data-ohs.GripStrength adm@opal>export -o a.xlsx opal-data-ohs.AnkleBrachial adm@opal>export -o a.xlsx opal-data-ohs.UrineSamplesCollection here, no big number of columns to be exported in each table above, the process of export was very smooth. ==>case b) only able to export one or two tables with extra multiple columns to a single excel file in this datasource, there're 3 tables with extra multiple columns (more than 256): opal-data-ohs.CIPreliminaryQuestionnaire opal-data-ohs.HealthQuestionnaireTouchScreen opal-data-ohs.HealthQuestionnaireNurse it worked fine when continued exporting any one of the 3 tables to the existing 'a.xls' (generated in case a): adm@opal>export -o a.xlsx opal-data-ohs.CIPreliminaryQuestionnaire then, continued exporting second table with extra multiple columns to the same 'a.xls' adm@opal>export -o a.xlsx opal-data-ohs.HealthQuestionnaireTouchScreen occassionally, it worked. once this worked, continute exporting the 3rd table 'opal-data-ohs.HealthQuestionnaireNurse', it would definitely give the error as follows (if the second table couldn't be exported successfully, the generated error would be the same one): Error info: org.obiba.magma.MagmaRuntimeException: org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException at org.obiba.magma.support.Initialisables.initialise(Initialisables.java:14) at org.obiba.magma.MagmaEngine.addDatasource(MagmaEngine.java:84) at org.obiba.opal.core.service.impl.DefaultExportServiceImpl.buildExcelDatasource(DefaultExportServiceImpl.java:110) at org.obiba.opal.core.service.impl.DefaultExportServiceImpl.exportTablesToExcelFile(DefaultExportServiceImpl.java:84) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy38.exportTablesToExcelFile(Unknown Source) at org.obiba.opal.cli.client.command.ExportCommand.execute(ExportCommand.java:35) at org.obiba.opal.cli.client.OpalConsole.prompt(OpalConsole.java:142) at org.obiba.opal.cli.client.OpalConsole.<init>(OpalConsole.java:109) at org.obiba.opal.cli.client.OpalConsole.main(OpalConsole.java:191) Caused by: org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:61) at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:256) at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:196) at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:172) at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:63) at org.obiba.magma.datasource.excel.ExcelDatasource.onInitialise(ExcelDatasource.java:84) at org.obiba.magma.support.AbstractDatasource.initialise(AbstractDatasource.java:80) at org.obiba.magma.support.Initialisables.initialise(Initialisables.java:10) ... 18 more Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:59) ... 25 more Caused by: java.io.IOException: error: Unexpected character encountered (lex state 9): '!' at org.apache.poi.xssf.model.SharedStringsTable.readFrom(SharedStringsTable.java:119) at org.apache.poi.xssf.model.SharedStringsTable.<init>(SharedStringsTable.java:97) ... 30 more

    JIRA | 7 years ago
    org.obiba.magma.MagmaRuntimeException: org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException
  2. 0

    Bug 56957 – Excel 2007 file is unusable after closing Workbook object

    apache.org | 8 months ago
    org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException
  3. 0

    Bug 48936 – Writing specific sequence of strings to XSSFSheet results in malformed XML

    apache.org | 8 months ago
    org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    POIXMLException reading xlsx

    poi-user | 5 years ago | davord
    java.lang.reflect.InvocationTargetException

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.io.IOException

      error: Unexpected character encountered (lex state 9): '!'

      at org.apache.poi.xssf.model.SharedStringsTable.readFrom()
    2. Apache POI
      SharedStringsTable.<init>
      1. org.apache.poi.xssf.model.SharedStringsTable.readFrom(SharedStringsTable.java:119)
      2. org.apache.poi.xssf.model.SharedStringsTable.<init>(SharedStringsTable.java:97)
      2 frames
    3. Java RT
      Constructor.newInstance
      1. sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      2. sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
      3. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
      4. java.lang.reflect.Constructor.newInstance(Unknown Source)
      4 frames
    4. Apache POI
      XSSFFactory.createDocumentPart
      1. org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:59)
      1 frame
    5. POI
      POIXMLDocument.load
      1. org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:256)
      2. org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:196)
      2 frames
    6. Apache POI
      XSSFWorkbook.<init>
      1. org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:172)
      1 frame
    7. POI
      WorkbookFactory.create
      1. org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:63)
      1 frame
    8. org.obiba.magma
      MagmaEngine.addDatasource
      1. org.obiba.magma.datasource.excel.ExcelDatasource.onInitialise(ExcelDatasource.java:84)
      2. org.obiba.magma.support.AbstractDatasource.initialise(AbstractDatasource.java:80)
      3. org.obiba.magma.support.Initialisables.initialise(Initialisables.java:10)
      4. org.obiba.magma.MagmaEngine.addDatasource(MagmaEngine.java:84)
      4 frames
    9. org.obiba.opal
      DefaultExportServiceImpl.exportTablesToExcelFile
      1. org.obiba.opal.core.service.impl.DefaultExportServiceImpl.buildExcelDatasource(DefaultExportServiceImpl.java:110)
      2. org.obiba.opal.core.service.impl.DefaultExportServiceImpl.exportTablesToExcelFile(DefaultExportServiceImpl.java:84)
      2 frames
    10. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      4. java.lang.reflect.Method.invoke(Unknown Source)
      4 frames
    11. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      3 frames
    12. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
      1 frame
    13. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      2 frames
    14. Unknown
      $Proxy38.exportTablesToExcelFile
      1. $Proxy38.exportTablesToExcelFile(Unknown Source)
      1 frame
    15. org.obiba.opal
      OpalConsole.main
      1. org.obiba.opal.cli.client.command.ExportCommand.execute(ExportCommand.java:35)
      2. org.obiba.opal.cli.client.OpalConsole.prompt(OpalConsole.java:142)
      3. org.obiba.opal.cli.client.OpalConsole.<init>(OpalConsole.java:109)
      4. org.obiba.opal.cli.client.OpalConsole.main(OpalConsole.java:191)
      4 frames