5 Replies Latest reply on Mar 22, 2007 1:25 PM by Sergey Smirnov

    Form with enctype: Java Heap Space-OutOfMemory error ???

    Lisa Mark Newbie

      Hi.,

      Environment: Seam 1.1.6, ajax4jsf1.1.0rc1, MyFaces 1.1.4, Tomahawk 1.1.3

      Problem: When I use a form with enctype (for fileupload case) which has some components ajax-ified then I'm getting a strange Java heap space -outOfMemoryError (for the first time I'm getting this error).
      Detail: The Ajax functionality is working pretty fine without any problem but when I invoke a action method then for few minutes the page hangs and throws heap space error.

      Take a look at code below:

      <h:form id="erfassungForm"
       acceptcharset="UTF-8" enctype="multipart/form-data">
      
       <h:selectBooleanCheckbox
       value="#{laufzettelBean.wieKunde}"
       id="wieKundeCheck">
       <ajax:support id="ajaxCheck"
       event="onclick"
       action="#{laufzettelBean.erfassungKundeCheckbox}"
       reRender="something" />
       </h:selectBooleanCheckbox>
      
       <h:outputText id="something"
       value="Anrede" />
      
       <!-- Action Methods -->
       <h:commandButton
       action="#{laufzettelBean.erfassungSpeichern}"
       value="Speichern">
       </h:commandButton>
      
       <h:commandButton
       action="#{laufzettelBean.erfassungAbbrechen}"
       value="Abbrechen">
       </h:commandButton>
       </h:form>
      


      First I thought it could be Seam problem but when I remove a4j tags then everything works fine (but i need a4j).

      Any help would be highly appreciated.

      Thanks.

        • 1. Re: Form with enctype: Java Heap Space-OutOfMemory error ???
          Sergey Smirnov Master

          There is no fileupload in your code snippet. Could you explain this.

          • 2. Re: Form with enctype: Java Heap Space-OutOfMemory error ???
            Lisa Mark Newbie

            Hi.,
            Thanks for your response.


            There is no fileupload in your code snippet. Could you explain this


            There is no fileupload code becos the same effect/result with and without fileupload (I tested both cases).

            Thanks

            • 3. Re: Form with enctype: Java Heap Space-OutOfMemory error ???
              Adrian Mitev Master

              I guess Sergey means that there is no reason to have multipart/form-data when you don't use file upload.

              • 4. Re: Form with enctype: Java Heap Space-OutOfMemory error ???
                Lisa Mark Newbie

                Hi.,
                Thankd for ur response.


                I guess Sergey means that there is no reason to have multipart/form-data when you don't use file upload


                You're right but I have fileupload component.. just to show in post I removed it. Moreover the error occurs independent of fileupload component.

                Also i think the error has something to do with MyFaces.

                For more info please look into the stack trace below


                14:48:44,188 ERROR [PhaseListenerManager] Exception in PhaseListener RESTORE_VIEW(1) afterPhase
                java.lang.NullPointerException
                 at org.apache.myfaces.renderkit.html.util.AutoScrollPhaseListener.afterPhase(AutoScrollPhaseListener.java:52)
                 at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:89)
                 at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:181)
                 at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:66)
                 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:97)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:75)
                 at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:213)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
                 at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                 at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
                 at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
                 at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
                 at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:74)
                 at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
                 at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
                 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
                 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
                 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
                 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.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
                 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
                 at java.lang.Thread.run(Thread.java:595)
                14:48:44,204 ERROR [ExceptionFilter] uncaught exception
                javax.servlet.ServletException: Java heap space
                 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:97)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:75)
                 at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:213)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
                 at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                 at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
                 at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
                 at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
                 at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:74)
                 at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
                 at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
                 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
                 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
                 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
                 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.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
                 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
                 at java.lang.Thread.run(Thread.java:595)
                


                Thanks


                • 5. Re: Form with enctype: Java Heap Space-OutOfMemory error ???
                  Sergey Smirnov Master

                   

                  "amitev" wrote:
                  I guess Sergey means that there is no reason to have multipart/form-data when you don't use file upload.


                  I mean, without huge value of transfered data I do not see where it might be a problem on our side. Processing the form is a job for JSF implementation itself.

                  Did anybody hear the problem with enctype="multipart/form-data" ?