poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Louis.Mast...@log-net.com
Subject Re: Problem with java heap space
Date Thu, 02 Dec 2010 15:12:43 GMT
What's your java heap set to?

Pablo Johnson <pjohnson@m1.aasa.com.pe> wrote on 12/02/2010 09:19:21 AM:

> hello!
> 
> i`m doing a web application and i`m having this problem:
> 
> 
>          java.lang.OutOfMemoryError: Java heap space
> org.apache.xmlbeans.impl.store.Cur.createElementXobj(Cur.java:257)
>          org.apache.xmlbeans.impl.store.Cur$CurLoadContext.
> startElement(Cur.java:2992)
>          org.apache.xmlbeans.impl.store.Locale$SaxHandler.
> startElement(Locale.java:3198)
>          org.apache.xmlbeans.impl.piccolo.xml.Piccolo.
> reportStartTag(Piccolo.java:1082)
>          org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer.
> parseAttributesNS(PiccoloLexer.java:1822)
>          org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer.
> parseOpenTagNS(PiccoloLexer.java:1521)
>          org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer.
> parseTagNS(PiccoloLexer.java:1362)
>          org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer.
> parseXMLNS(PiccoloLexer.java:1293)
>          org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer.
> parseXML(PiccoloLexer.java:1261)
>          org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer.
> yylex(PiccoloLexer.java:4808)
> org.apache.xmlbeans.impl.piccolo.xml.Piccolo.yylex(Piccolo.java:1290)
>          org.apache.xmlbeans.impl.piccolo.xml.Piccolo.
> yyparse(Piccolo.java:1400)
> org.apache.xmlbeans.impl.piccolo.xml.Piccolo.parse(Piccolo.java:714)
>          org.apache.xmlbeans.impl.store.Locale$SaxLoader.
> load(Locale.java:3439)
>          org.apache.xmlbeans.impl.store.Locale.
> parseToXmlObject(Locale.java:1270)
>          org.apache.xmlbeans.impl.store.Locale.
> parseToXmlObject(Locale.java:1257)
>          org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.
> parse(SchemaTypeLoaderBase.java:345)
>          org.openxmlformats.schemas.spreadsheetml.x2006.main.
> WorksheetDocument$Factory.parse(Unknown 
> Source)
> org.apache.poi.xssf.usermodel.XSSFSheet.read(XSSFSheet.java:170)
>          org.apache.poi.xssf.usermodel.XSSFSheet.
> onDocumentRead(XSSFSheet.java:162)
>          org.apache.poi.xssf.usermodel.XSSFWorkbook.
> onDocumentRead(XSSFWorkbook.java:227)
>          org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:190)
>          org.apache.poi.xssf.usermodel.XSSFWorkbook.
> <init>(XSSFWorkbook.java:175)
>          org.apache.poi.ss.usermodel.WorkbookFactory.
> create(WorkbookFactory.java:63)
> com.aasa.logic.DespieceLogic.trabajaPlantilla(DespieceLogic.java:449)
>          com.aasa.logic.DespieceLogic.
> trabajarAsignacion(DespieceLogic.java:76)
>          com.aasa.action.LisBandejaDespieceAction.
> descargaArchivo(LisBandejaDespieceAction.java:360)
>          sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>          sun.reflect.NativeMethodAccessorImpl.
> invoke(NativeMethodAccessorImpl.java:39)
>          sun.reflect.DelegatingMethodAccessorImpl.
> invoke(DelegatingMethodAccessorImpl.java:25)
>          java.lang.reflect.Method.invoke(Method.java:592)
>          org.apache.struts.actions.DispatchAction.
> dispatchMethod(DispatchAction.java:274)
> 
> 
> 
> I`m trying to open a .xlsm file with 2.06 mb. This is my code:
> 
>             fileIn = new SmbFileInputStream(plantilla);
>          wb = WorkbookFactory.create(fileIn); // <------------this 
> line is the problem
> 
>          final Sheet sheetDespacho = wb.getSheet("DESPACHOS");
>          for (int i=0; i<lstDespacho.size();i++){
>          Row row = sheetDespacho.getRow(i);
>                  if (row == null){
>                  row = sheetDespacho.createRow(i);
>                  }
>                  Cell cell = row.getCell(0);
>                  if (cell == null){
>                  cell = row.createCell(0);
>                  }
>                  cell.setCellValue(new Integer(lstDespacho.get(i)));
> 
>                  cell = row.getCell(1);
>                  if (cell == null){
>                  cell = row.createCell(1);
>                  }
>                  cell.setCellValue(i+1);
>          }
> 
> 
> is there any other way to open this file? because it always throw me 
> that exception:
> javax.servlet.ServletException: Java heap space
> 
> thanks. 
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message