title: Reading .xlsx file using apache poi gives org.apache.poi.POIXMLException on linux machine
body: <p>I have an application which reads an .xlsx file and displays the content to the user. The application works fine on a windows environment.</p>
  
  <p>I deployed the .war file of this web app on tomcat6 on a ubuntu server. I also copied the .xlsx files on the server.</p>
  
  <p>The path of the files in the code is correct.</p>
  
  <p>But the line </p>
  
  <pre><code>FileInputStream file = new FileInputStream(new File(FileName));
  XSSFWorkbook workbook = new XSSFWorkbook(file);
  </code></pre>
  
  <p>gives an error</p>
  
  <pre><code>java.lang.reflect.InvocationTargetException
  org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException
  org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:62)
  org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:403)
  org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:155)
  org.apache.poi.xssf.usermodel.XSSFWorkbook.&lt;init&gt;(XSSFWorkbook.java:207)
  com.qm.action.GetProjectNames.execute(GetProjectNames.java:107)
  </code></pre>
  
  <p>I have checked that the variable FileName contains the correct path and filename of the files on server(/usr/local/Metrics/MetricFiles/FY2013_Q2_GIT_Review_Metrics_by_LSS-GC.xlsx)</p>
  
  <p>Since the ubunut server is a VM, I had copied the .xlsx files using WinSCP. The size of the files is also correct. </p>
  
  <p>Why is this error occurring on linux platform?</p>
  
  <p>Adding the Additional exception trace</p>
  
  <pre><code>Caused by: java.lang.reflect.InvocationTargetException 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:525) at 
  org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:60) ... 68 more 
  Caused by: java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOfRange(Arrays.java:2694) at java.lang.String.&lt;init&gt;(String.java:203) at 
  org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer.parseCdataLiteral(PiccoloLexer.java:3027) at 
  org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer.parseQuotedTagValue(PiccoloLexer.java:2936) at 
  org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer.parseAttributesNS(PiccoloLexer.java:1754) at 
  org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer.parseOpenTagNS(PiccoloLexer.java:1521) at 
  org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer.parseTagNS(PiccoloLexer.java:1362) at 
  org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer.yylex(PiccoloLexer.java:4678) at 
  org.apache.xmlbeans.impl.piccolo.xml.Piccolo.yylex(Piccolo.java:1290) at 
  org.apache.xmlbeans.impl.piccolo.xml.Piccolo.yyparse(Piccolo.java:1400) at 
  org.apache.xmlbeans.impl.piccolo.xml.Piccolo.parse(Piccolo.java:714) at 
  org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3439) at 
  org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1270) at 
  org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1257) at 
  org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:345) at 
  org.openxmlformats.schemas.spreadsheetml.x2006.main.StyleSheetDocument$Factory.parse(Unknown Source) at 
  org.apache.poi.xssf.model.StylesTable.readFrom(StylesTable.java:121) at 
  org.apache.poi.xssf.model.StylesTable.&lt;init&gt;(StylesTable.java:92) 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:525) at 
  org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:60) at 
  org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:403) at 
  org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:155) at 
  org.apache.poi.xssf.usermodel.XSSFWorkbook.&lt;init&gt;(XSSFWorkbook.java:207) at 
  com.qm.action.GetProjectNames.execute(GetProjectNames.java:107) at 
  sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at 
  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at 
  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at 
  java.lang.reflect.Method.invoke(Method.java:601) at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452)
  </code></pre>