Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Java heap space

 
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to open 3.24MB Quaterly.xsl from jsp.

Here is the code

<%@ page import="org.apache.poi.hssf.usermodel.HSSFSheet"%>
<%@ page import="org.apache.poi.hssf.usermodel.HSSFWorkbook"%>
<%@ page import="org.apache.poi.poifs.filesystem.POIFSFileSystem"%>
<%@ page contentType="application/vnd.ms-excel" %>
<%@ page import="java.io.*" %>
<%
try{
POIFSFileSystem fs=new POIFSFileSystem(new FileInputStream
("c:\\excel\\Quarterly2007.xls"));
HSSFWorkbook wb=new HSSFWorkbook(fs);
FileOutputStream fileOut = new FileOutputStream(
"c:\\excel\\readingWriting.xls");
wb.write(fileOut);
fileOut.close();
out.println("Your excel file has been generated");

} catch ( Exception ex ) {
}
%>


I got this errors:

java.lang.OutOfMemoryError: Java heap space
13:53:13,953 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
java.lang.SecurityException: SHA1 digest error for javax/mail/SecuritySupport12.class
at sun.security.util.ManifestEntryVerifier.verify(ManifestEntryVerifier.java:196)
at java.util.jar.JarVerifier.processEntry(JarVerifier.java:201)
at java.util.jar.JarVerifier.update(JarVerifier.java:188)
at java.util.jar.JarInputStream.read(JarInputStream.java:176)
at java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:91)
at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:69)
at java.util.jar.JarInputStream.getNextEntry(JarInputStream.java:118)
at java.util.jar.JarInputStream.getNextJarEntry(JarInputStream.java:149)
at org.jboss.web.tomcat.tc5.jasper.TagLibCache.scanJar(TagLibCache.java:324)
at org.jboss.web.tomcat.tc5.jasper.TagLibCache.processTldsInFileSystem(TagLibCache.java:268)
at org.jboss.web.tomcat.tc5.jasper.TagLibCache.processTldsInFileSystem(TagLibCache.java:261)
at org.jboss.web.tomcat.tc5.jasper.TagLibCache.init(TagLibCache.java:101)
at org.jboss.web.tomcat.tc5.jasper.TagLibCache.getLocation(TagLibCache.java:83)
at org.apache.jasper.JspCompilationContext.getTldLocation(JspCompilationContext.java:526)
at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:422)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:492)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1556)
at org.apache.jasper.compiler.Parser.parse(Parser.java:126)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:155)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:465)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:363)
at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:212)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:134)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)

How would I handle this errors in java.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can set the appropriate heap size in the run.bat file which is present in %JBOSS_HOME%/bin folder. Something like this:



Restart JBoss after changing this file.
 
    Bookmark Topic Watch Topic
  • New Topic