Results 1 to 13 of 13
  1. #1
    009
    009 is offline Member
    Join Date
    May 2014
    Posts
    22
    Rep Power
    0

    Default how to tune and optimize POI Code

    hi am exporting adf table to excell i what to optimize my code using BigGridDemo.java

    how can i do the same using below code

    [code]
    Java Code:
    public void generateExcel(FacesContext facesContext, OutputStream outputStream) throws IOException {
    
     
    	try {
    
     
    	
    
     
    	
    	
    	
    	
    	
    	XSSFWorkbook workbook = new XSSFWorkbook();
    	XSSFSheet worksheet = workbook.createSheet("Big Grid");
    	
    	
    	
    
     
    	// Get all the rows of a iterator
    	/////////////////////////////////////////////////////////////////////////////////////////////////////
    
     
    	DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    	DCIteratorBinding dcIteratorBindings = bindings.findIteratorBinding("CustomClientView1Iterator");
    	
    	Row rowss = worksheet.createRow(0);
    	ViewObject yourVO= dcIteratorBindings.getViewObject();
    	// Get all the rows of a ViewObject
    	RowSetIterator iter = yourVO.createRowSetIterator("CustomClient");
    	iter.reset();
    	int rowCounter = 0;
    	while (iter.hasNext()){
    	Cell cell = null;
    	oracle.jbo.Row row = iter.next();
    
     
    	//print header on first row in excel
    	if (rowCounter == 0) {
    	rowss = worksheet.createRow(rowCounter);
    	int cellCounter = 0;
    
     
    	for (String colName : row.getAttributeNames()) {
    	cell = rowss.createCell(cellCounter);
    	cell.setCellValue(colName);
    
     
    	// cellA1.setCellValue(colName);
    
     
    	cellCounter++;
    	}
    	}
    	//print data from second row in excel
    
     
    	rowCounter++;
    	//////////////////////////////////////////////////////////////
    	
    
     
    	int cellCounter = 0;
    
     
    	
    
     
    
     
    	rowss = worksheet.createRow(rowCounter);
    	for (String colName : row.getAttributeNames()) {
    	System.out.println("hello "+row.getAttribute(colName));
    	System.out.println("hello "+colName);
    	
    	cell = rowss.createCell(cellCounter);
    	rowCounter++;
    
     
    	/// cell.setCellValue(new HSSFRichTextString(rs.getS));
    	if(!isBlank(colName)){
    	if (colName.equalsIgnoreCase("CcnCode")) {
    	cell.setCellValue(row.getAttribute(colName).toString());
    	System.out.println("colName "+colName+"row.getAttribute(colName).toString()"+row.getAttribute(colName).toString());
    	}
    	}
    	//logic for cell formatting
    	
    	else if (colName.equalsIgnoreCase("CcnName")) {
    	cell.setCellValue(row.getAttribute(colName).toString());
    	}
    	
    
     
    	//make it double if you want and convert accordingly
    	else if (colName.equalsIgnoreCase("CcnRegDate")){
    	cell.setCellValue(row.getAttribute(colName).toString());
    	}
    
     
    	else if (colName.equalsIgnoreCase("CcnCancelDate")){
    
     
    	if(null!=row.getAttribute(colName)){
    
     
    	cell.setCellValue(row.getAttribute(colName).toString());
    
     
    	}
    
     
    	} else if (colName.equalsIgnoreCase("CcnUndertaking")){
    
     
    	if(null!=row.getAttribute(colName)){
    	cell.setCellValue(row.getAttribute(colName).toString());
    	}
    	}
    
     
    	else if (colName.equalsIgnoreCase("CcnCode8")){
    
     
    	if(null!=row.getAttribute(colName)){
    
     
    	cell.setCellValue(row.getAttribute(colName).toString());
    
     
    	}                                                                                                     	}
    
     
    	else
    	cell.setCellValue(row.getAttribute(colName).toString());
    	cellCounter++;
    	}
    
     
    	worksheet.createFreezePane(0, 1, 0, 1);
    	}
    	workbook.write(outputStream);
    	outputStream.flush();
    	}
    	
    	
    	catch (Exception e) {
    	e.printStackTrace();
    	}   	
    	}
    [code]
    AM running out of memory

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,225
    Rep Power
    20

    Default Re: how to tune and optimize POI Code

    How big is the spreadsheet?
    How much data are you trying to put into it?

    Does the ViewObject hold all the data to go into the spreadsheet, or is it loading that data one row at a time (similar to ResultSet)?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,225
    Rep Power
    20

    Default Re: how to tune and optimize POI Code

    Having read your reply in the other thread:
    Quote Originally Posted by 009 View Post
    am having 297052 rows and 6 columns ,yes am running out of memory.i think the size is 14.5 MB
    Well, that is a lot.
    Have you looked into SXSSF, the streaming version of XSSF, which uses the BigGridDemo strategy?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  4. #4
    009
    009 is offline Member
    Join Date
    May 2014
    Posts
    22
    Rep Power
    0

    Default Re: how to tune and optimize POI Code

    yes the ViewObject hold all the data to go into the spreadsheet
    you mean this
    Workbook workbook = new XSSFWorkbook();
    Sheet worksheet = workbook.createSheet("Fonts");

    i have use this still geting out of memory

    where is the jar file which got SXSSF,the one i have are giving error
    Last edited by 009; 06-09-2014 at 02:40 PM.

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,225
    Rep Power
    20

    Default Re: how to tune and optimize POI Code

    It came in in 3.8, so will be in the latest (3.10) version.
    It's the streaming version of XSSF.

    If your VO has all the data in it, rather than being a cursor into the database, then that could also be a problem. You're loading the whole lot into memory and the copying it into another format (Excel), also (currently) in memory.

    Of course, this is a bit of guesswork here. You really should, with a memory problem like this, take a heap dump and analyse it to check exactly what is taking up the space.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  6. #6
    009
    009 is offline Member
    Join Date
    May 2014
    Posts
    22
    Rep Power
    0

    Default Re: how to tune and optimize POI Code

    how to tune and optimize POI Code-bigdata.jpg
    ok i did the heap dump and anaylse by -XX:+HeapDumpOnOutOfMemoryError

    i open file java_pid5192.hprof where must i check exactly what is taking up the space.

    am geting
    java.lang.OutOfMemoryError: Java heap space
    Dumping heap to java_pid5192.hprof ...
    Heap dump file created [628911929 bytes in 9.509 secs]
    <FileDownloadActionListener> <processAction>
    javax.el.ELException: java.lang.OutOfMemoryError: Java heap space
    at com.sun.el.parser.AstValue.invoke(Unknown Source)
    at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
    at org.apache.myfaces.trinidadinternal.taglib.listene r.FileDownloadActionListener.processAction(FileDow nloadActionListener.java:121)
    at oracle.adfinternal.view.faces.event.rich.FileDownl oadActionListener.processAction(FileDownloadAction Listener.java:88)
    at javax.faces.event.ActionEvent.processListener(Acti onEvent.java:88)
    at org.apache.myfaces.trinidad.component.UIXComponent Base.broadcast(UIXComponentBase.java:748)
    at org.apache.myfaces.trinidad.component.UIXCommand.b roadcast(UIXCommand.java:179)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleI mpl.broadcastEvents(LifecycleImpl.java:1086)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleI mpl._executePhase(LifecycleImpl.java:434)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleI mpl.execute(LifecycleImpl.java:207)
    at javax.faces.webapp.FacesServlet.service(FacesServl et.java:265)
    at weblogic.servlet.internal.StubSecurityHelper$Servl etServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invok eServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute( ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(Tail Filter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter (FilterChainImpl.java:56)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter (ADFBindingFilter.java:205)
    at weblogic.servlet.internal.FilterChainImpl.doFilter (FilterChainImpl.java:56)
    at oracle.adfinternal.view.faces.webapp.rich.Registra tionFilter.doFilter(RegistrationFilter.java:128)
    at org.apache.myfaces.trinidadinternal.webapp.Trinida dFilterImpl$FilterListChain.doFilter(TrinidadFilte rImpl.java:446)
    at oracle.adfinternal.view.faces.activedata.AdsFilter .doFilter(AdsFilter.java:60)
    at org.apache.myfaces.trinidadinternal.webapp.Trinida dFilterImpl$FilterListChain.doFilter(TrinidadFilte rImpl.java:446)
    at org.apache.myfaces.trinidadinternal.webapp.Trinida dFilterImpl._doFilterImpl(TrinidadFilterImpl.java: 271)
    at org.apache.myfaces.trinidadinternal.webapp.Trinida dFilterImpl.doFilter(TrinidadFilterImpl.java:177)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter. doFilter(TrinidadFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter (FilterChainImpl.java:56)
    at oracle.adf.library.webapp.LibraryFilter.doFilter(L ibraryFilter.java:180)
    at weblogic.servlet.internal.FilterChainImpl.doFilter (FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(Jps AbsFilter.java:119)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged (JpsSubject.java:324)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaa sMode(JpsPlatformUtil.java:460)
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMo de(JpsAbsFilter.java:103)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter( JpsAbsFilter.java:171)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(Jps Filter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter (FilterChainImpl.java:56)
    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSSe rvletFilter.java:163)
    at weblogic.servlet.internal.FilterChainImpl.doFilter (FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFi lter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter (FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationAction.wrapRun(WebAppServletContext. java:3715)
    at weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationAction.run(WebAppServletContext.java :3681)
    at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.sec uredExecute(WebAppServletContext.java:2277)
    at weblogic.servlet.internal.WebAppServletContext.exe cute(WebAppServletContext.java:2183)
    at weblogic.servlet.internal.ServletRequestImpl.run(S ervletRequestImpl.java:1454)
    at weblogic.work.ExecuteThread.execute(ExecuteThread. java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java :178)
    Caused by: java.lang.OutOfMemoryError: Java heap space
    at org.apache.xmlbeans.impl.store.Saver$TextSaver.res ize(Saver.java:1700)
    at org.apache.xmlbeans.impl.store.Saver$TextSaver.pre Emit(Saver.java:1303)
    at org.apache.xmlbeans.impl.store.Saver$TextSaver.emi t(Saver.java:1190)
    at org.apache.xmlbeans.impl.store.Saver$TextSaver.emi tElement(Saver.java:962)
    at org.apache.xmlbeans.impl.store.Saver.processElemen t(Saver.java:476)
    at org.apache.xmlbeans.impl.store.Saver.process(Saver .java:307)
    at org.apache.xmlbeans.impl.store.Saver$TextSaver.sav eToString(Saver.java:1864)
    at org.apache.xmlbeans.impl.store.Cursor._xmlText(Cur sor.java:546)
    at org.apache.xmlbeans.impl.store.Cursor.xmlText(Curs or.java:2436)
    at org.apache.xmlbeans.impl.values.XmlObjectBase.xmlT ext(XmlObjectBase.java:1500)
    at org.apache.xmlbeans.impl.values.XmlObjectBase.toSt ring(XmlObjectBase.java:1485)
    at org.apache.poi.xssf.model.SharedStringsTable.addEn try(SharedStringsTable.java:167)
    at org.apache.poi.xssf.usermodel.XSSFCell.setCellValu e(XSSFCell.java:345)
    at org.apache.poi.xssf.usermodel.XSSFCell.setCellValu e(XSSFCell.java:315)
    at vinay.view.PoiBean.generateExcel(PoiBean.java:158)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sun.el.parser.AstValue.invoke(Unknown Source)
    at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
    at org.apache.myfaces.trinidadinternal.taglib.listene r.FileDownloadActionListener.processAction(FileDow nloadActionListener.java:121)
    at oracle.adfinternal.view.faces.event.rich.FileDownl oadActionListener.processAction(FileDownloadAction Listener.java:88)
    at javax.faces.event.ActionEvent.processListener(Acti onEvent.java:88)
    at org.apache.myfaces.trinidad.component.UIXComponent Base.broadcast(UIXComponentBase.java:748)
    at org.apache.myfaces.trinidad.component.UIXCommand.b roadcast(UIXCommand.java:179)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleI mpl.broadcastEvents(LifecycleImpl.java:1086)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleI mpl._executePhase(LifecycleImpl.java:434)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleI mpl.execute(LifecycleImpl.java:207)
    at javax.faces.webapp.FacesServlet.service(FacesServl et.java:265)
    at weblogic.servlet.internal.StubSecurityHelper$Servl etServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invok eServlet(StubSecurityHelper.java:125)
    <09 Jun 2014 3:00:54 PM> <Error> <Socket> <BEA-000421> <Uncaught Throwable in processSockets
    java.lang.OutOfMemoryError: Java heap space.
    java.lang.OutOfMemoryError: Java heap space
    at java.io.DataInputStream.<init>(DataInputStream.jav a:42)
    at java.io.ObjectInputStream$BlockDataInputStream.<in it>(ObjectInputStream.java:2357)
    at java.io.ObjectInputStream.<init>(ObjectInputStream .java:275)
    at weblogic.utils.io.ChunkedObjectInputStream$NestedO bjectInputStream.<init>(ChunkedObjectInputStream.j ava:257)
    at weblogic.rjvm.MsgAbbrevInputStream$NestedObjectInp utStream.<init>(MsgAbbrevInputStream.java:708)
    Truncated. see log file for complete stacktrace
    >
    Last edited by 009; 06-09-2014 at 04:24 PM.

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,225
    Rep Power
    20

    Default Re: how to tune and optimize POI Code

    Work through the biggest objects first?
    You can skip char[], but the second biggest (at around 200Mb) is something in Apache, possibly being used by POI.
    So have a look at exactly where those are being used.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  8. #8
    009
    009 is offline Member
    Join Date
    May 2014
    Posts
    22
    Rep Power
    0

    Default Re: how to tune and optimize POI Code

    hi i change a code to use SXSSFWorkbook
    am geting error in this line the error is in this line cell = rowss.createCell(cellCounter);

    Java Code:
    public void generateExcel(FacesContext facesContext, OutputStream outputStream) throws IOException {
    
         
                try {
                                       
                    SXSSFWorkbook workbook = new  SXSSFWorkbook();
                    SXSSFSheet worksheet = (SXSSFSheet)workbook.createSheet("Big Grid");
                    
                // Get all the rows of a iterator
                /////////////////////////////////////////////////////////////////////////////////////////////////////
    
         
                DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
                DCIteratorBinding dcIteratorBindings = bindings.findIteratorBinding("CustomClientView1Iterator");
                
                Row rowss = worksheet.createRow(0);
                ViewObject yourVO= dcIteratorBindings.getViewObject();
                // Get all the rows of a ViewObject
                RowSetIterator iter = yourVO.createRowSetIterator("CustomClient");
                iter.reset();
                int rowCounter = 0;
                while (iter.hasNext()){
                Cell cell = null;
                oracle.jbo.Row row = iter.next();
    
         
                //print header on first row in excel
                if (rowCounter == 0) {
                rowss = worksheet.createRow(rowCounter);
                int cellCounter = 0;
    
         
                for (String colName : row.getAttributeNames()) {
                cell = rowss.createCell(cellCounter);
                cell.setCellValue(colName);
         
                // cellA1.setCellValue(colName)    
                cellCounter++;
                }
                }
                //print data from second row in excel
    
         
                rowCounter++;
                //////////////////////////////////////////////////////////////     
                int cellCounter = 0;
         
                rowss = worksheet.createRow(rowCounter);
                for (String colName : row.getAttributeNames()) {
                System.out.println("hello "+row.getAttribute(colName));
                System.out.println("hello "+colName);
                
                cell = rowss.createCell(cellCounter);
                rowCounter++;
    
         
                /// cell.setCellValue(new HSSFRichTextString(rs.getS));
                if(!isBlank(colName)){
                if (colName.equalsIgnoreCase("CcnCode")) {
                cell.setCellValue(row.getAttribute(colName).toString());
                System.out.println("colName "+colName+"row.getAttribute(colName).toString()"+row.getAttribute(colName).toString());
                }
                }
                //logic for cell formatting
                
                else if (colName.equalsIgnoreCase("CcnName")) {
                cell.setCellValue(row.getAttribute(colName).toString());
                }
                
    
         
                //make it double if you want and convert accordingly
                else if (colName.equalsIgnoreCase("CcnRegDate")){
                cell.setCellValue(row.getAttribute(colName).toString());
                }
    
         
                else if (colName.equalsIgnoreCase("CcnCancelDate")){
    
         
                if(null!=row.getAttribute(colName)){
    
         
                cell.setCellValue(row.getAttribute(colName).toString());
    
         
                }
    
         
                } else if (colName.equalsIgnoreCase("CcnUndertaking")){
        
                if(null!=row.getAttribute(colName)){
                cell.setCellValue(row.getAttribute(colName).toString());
                }
                }
                else if (colName.equalsIgnoreCase("CcnCode8")){
                if(null!=row.getAttribute(colName)){
                cell.setCellValue(row.getAttribute(colName).toString());
                }                                                                                                       }
    
         
                else
                cell.setCellValue(row.getAttribute(colName).toString());
                cellCounter++;
                }
    
         
                worksheet.createFreezePane(0, 1, 0, 1);
                }
                workbook.write(outputStream);
                outputStream.flush();
                }
                
                
                catch (Exception e) {
                e.printStackTrace();
                }       
                }
    am geting this error
    java.lang.IllegalArgumentException: Invalid row number (1048580) outside allowable range (0..1048575)

    at org.apache.poi.xssf.streaming.SXSSFSheet.createRow (SXSSFSheet.java:105)

    at vinay.view.PoiBean.generateExcel(PoiBean.java:153)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)

    at java.lang.reflect.Method.invoke(Method.java:597)

    at com.sun.el.parser.AstValue.invoke(Unknown Source)

    at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)

    at org.apache.myfaces.trinidadinternal.taglib.listene r.FileDownloadActionListener.processAction(FileDow nloadActionListener.java:121)

    at oracle.adfinternal.view.faces.event.rich.FileDownl oadActionListener.processAction(FileDownloadAction Listener.java:88)

    at javax.faces.event.ActionEvent.processListener(Acti onEvent.java:88)

    at org.apache.myfaces.trinidad.component.UIXComponent Base.broadcast(UIXComponentBase.java:748)

    at org.apache.myfaces.trinidad.component.UIXCommand.b roadcast(UIXCommand.java:179)

    at oracle.adfinternal.view.faces.lifecycle.LifecycleI mpl.broadcastEvents(LifecycleImpl.java:1086)

    at oracle.adfinternal.view.faces.lifecycle.LifecycleI mpl._executePhase(LifecycleImpl.java:434)

    at oracle.adfinternal.view.faces.lifecycle.LifecycleI mpl.execute(LifecycleImpl.java:207)

    at javax.faces.webapp.FacesServlet.service(FacesServl et.java:265)

    at weblogic.servlet.internal.StubSecurityHelper$Servl etServiceAction.run(StubSecurityHelper.java:227)

    at weblogic.servlet.internal.StubSecurityHelper.invok eServlet(StubSecurityHelper.java:125)

    at weblogic.servlet.internal.ServletStubImpl.execute( ServletStubImpl.java:300)

    at weblogic.servlet.internal.TailFilter.doFilter(Tail Filter.java:26)

    at weblogic.servlet.internal.FilterChainImpl.doFilter (FilterChainImpl.java:56)

    at oracle.adf.model.servlet.ADFBindingFilter.doFilter (ADFBindingFilter.java:205)

    at weblogic.servlet.internal.FilterChainImpl.doFilter (FilterChainImpl.java:56)

    at oracle.adfinternal.view.faces.webapp.rich.Registra tionFilter.doFilter(RegistrationFilter.java:128)

    at org.apache.myfaces.trinidadinternal.webapp.Trinida dFilterImpl$FilterListChain.doFilter(TrinidadFilte rImpl.java:446)

    at oracle.adfinternal.view.faces.activedata.AdsFilter .doFilter(AdsFilter.java:60)

    at org.apache.myfaces.trinidadinternal.webapp.Trinida dFilterImpl$FilterListChain.doFilter(TrinidadFilte rImpl.java:446)

    at org.apache.myfaces.trinidadinternal.webapp.Trinida dFilterImpl._doFilterImpl(TrinidadFilterImpl.java: 271)

    at org.apache.myfaces.trinidadinternal.webapp.Trinida dFilterImpl.doFilter(TrinidadFilterImpl.java:177)

    at org.apache.myfaces.trinidad.webapp.TrinidadFilter. doFilter(TrinidadFilter.java:92)

    at weblogic.servlet.internal.FilterChainImpl.doFilter (FilterChainImpl.java:56)

    at oracle.adf.library.webapp.LibraryFilter.doFilter(L ibraryFilter.java:180)

    at weblogic.servlet.internal.FilterChainImpl.doFilter (FilterChainImpl.java:56)

    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(Jps AbsFilter.java:119)

    at java.security.AccessController.doPrivileged(Native Method)

    at oracle.security.jps.util.JpsSubject.doAsPrivileged (JpsSubject.java:324)

    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaa sMode(JpsPlatformUtil.java:460)

    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMo de(JpsAbsFilter.java:103)

    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter( JpsAbsFilter.java:171)

    at oracle.security.jps.ee.http.JpsFilter.doFilter(Jps Filter.java:71)

    at weblogic.servlet.internal.FilterChainImpl.doFilter (FilterChainImpl.java:56)

    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSSe rvletFilter.java:163)

    at weblogic.servlet.internal.FilterChainImpl.doFilter (FilterChainImpl.java:56)

    at weblogic.servlet.internal.RequestEventsFilter.doFi lter(RequestEventsFilter.java:27)

    at weblogic.servlet.internal.FilterChainImpl.doFilter (FilterChainImpl.java:56)

    at weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationAction.wrapRun(WebAppServletContext. java:3715)

    at weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationAction.run(WebAppServletContext.java :3681)

    at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubject.java:321)

    at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:120)

    at weblogic.servlet.internal.WebAppServletContext.sec uredExecute(WebAppServletContext.java:2277)

    at weblogic.servlet.internal.WebAppServletContext.exe cute(WebAppServletContext.java:2183)

    at weblogic.servlet.internal.ServletRequestImpl.run(S ervletRequestImpl.java:1454)

    at weblogic.work.ExecuteThread.execute(ExecuteThread. java:209)

    at weblogic.work.ExecuteThread.run(ExecuteThread.java :178)

  9. #9
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,346
    Rep Power
    6

    Default Re: how to tune and optimize POI Code

    The error is pretty clear: you're not allowed to stick more than 1048575 rows in the sheet and the code is trying to do that. Excel sheets have always had a maximum size; in older versions it was as low as 64k rows.

    Possibly your rowcounter variable is incremented too many times.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  10. #10
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,346
    Rep Power
    6

    Default Re: how to tune and optimize POI Code

    Multiposted:

    https://community.oracle.com/thread/3569484

    If you ask the same question in multiple forums (nothing wrong with that), be so kind to post a link to it so other people can follow it and see what has already been answered - to not spend half an hour typing up a reply when you already solved your problem long ago.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  11. #11
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,225
    Rep Power
    20

    Default Re: how to tune and optimize POI Code

    Who in their right mind wants an Excel sheet with over a million rows on it?

    Talk about abusing a technology...
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  12. #12
    009
    009 is offline Member
    Join Date
    May 2014
    Posts
    22
    Rep Power
    0

    Default Re: how to tune and optimize POI Code

    i think is a bug in my code i what to create 297052 rows

  13. #13
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,225
    Rep Power
    20

    Default Re: how to tune and optimize POI Code

    And 300,000 rows is much better?

    I'll never understand the "Excel sheet as database" stuff.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Replies: 9
    Last Post: 09-11-2011, 06:27 PM
  2. How to tune java performance on low end machines?
    By couling in forum Advanced Java
    Replies: 2
    Last Post: 03-10-2011, 10:11 AM
  3. why is it so slow? need to optimize it?
    By skarosg3 in forum Advanced Java
    Replies: 15
    Last Post: 10-08-2010, 09:54 AM
  4. Optimize my Code please....
    By mindblaster in forum New To Java
    Replies: 5
    Last Post: 02-06-2010, 12:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •