9 Replies Latest reply on Sep 11, 2015 10:59 AM by Jason Nielson

    Bug: RF 4.5.8 fileUpload =>"java.util.zip.ZipException: invalid literal/lengths set"

    Edilmar Alves Expert

      Hi,

       

      My webapp environment is: Glassfish 3.1.2.2 + JSF 2.1.29 + CDI/Weld + DeltaSpike 1.5.0 + Richfaces + JasperReports 6.0.3 + JPA 2 + Hibernate 4.2.7.

      I downloaded the last version of RF 4.5.8.

      I was using 4.5.4 fine with all the components.

      But 4.5.8 arised this exception with fileUpload:

       

      Grave: invalid literal/lengths set

      java.util.zip.ZipException: invalid literal/lengths set

          at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:164)

          at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:117)

          at java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java:2313)

          at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2326)

          at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2797)

          at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:802)

          at java.io.ObjectInputStream.<init>(ObjectInputStream.java:299)

          at com.sun.faces.renderkit.ApplicationObjectInputStream.<init>(ApplicationObjectInputStream.java:81)

          at com.sun.faces.spi.SerializationProviderFactory$JavaSerializationProvider.createObjectInputStream(SerializationProviderFactory.java:215)

          at com.sun.faces.renderkit.ClientSideStateHelper.doGetState(ClientSideStateHelper.java:284)

          at com.sun.faces.renderkit.ClientSideStateHelper.getState(ClientSideStateHelper.java:244)

          at com.sun.faces.renderkit.ResponseStateManagerImpl.getState(ResponseStateManagerImpl.java:100)

          at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:534)

          at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:142)

          at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:301)

          at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:301)

          at org.richfaces.application.GlobalResourcesViewHandler.restoreView(GlobalResourcesViewHandler.java:179)

          at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:301)

          at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:192)

          at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

          at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)

          at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

          at org.apache.deltaspike.jsf.impl.listener.request.DeltaSpikeLifecycleWrapper.execute(DeltaSpikeLifecycleWrapper.java:89)

          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)

          at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

          at util.OpenSessionInViewFilter.doFilter(OpenSessionInViewFilter.java:50)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)

          at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)

          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)

          at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)

          at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)

          at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)

          at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)

          at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)

          at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)

          at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)

          at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)

          at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)

          at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)

          at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)

          at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)

          at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)

          at com.sun.grizzly.ContextTask.run(ContextTask.java:71)

          at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)

          at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)

          at java.lang.Thread.run(Thread.java:745)

       

        • 1. Re: Bug: RF 4.5.8 fileUpload =>"java.util.zip.ZipException: invalid literal/lengths set"
          Michal Petrov Master

          Hi,

           

          it looks like an I/O error, does it happen every time? There's no RichFaces class in the stacktrace so I can't really tell what's going on.

          • 2. Re: Bug: RF 4.5.8 fileUpload =>"java.util.zip.ZipException: invalid literal/lengths set"
            Edilmar Alves Expert

            But this is really a problem with new version of Richfaces. Today I came back to 4.5.4 and in the same JSF page the fileUpload comp works fine. I don't know if this problem occurs also with 4.5.5/4.5.6/4.5.7 because I didn't test with these versions. Below the complete exception arised:

             

            Grave: invalid literal/lengths set

            java.util.zip.ZipException: invalid literal/lengths set

                at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:164)

                at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:117)

                at java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java:2313)

                at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2326)

                at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2797)

                at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:802)

                at java.io.ObjectInputStream.<init>(ObjectInputStream.java:299)

                at com.sun.faces.renderkit.ApplicationObjectInputStream.<init>(ApplicationObjectInputStream.java:81)

                at com.sun.faces.spi.SerializationProviderFactory$JavaSerializationProvider.createObjectInputStream(SerializationProviderFactory.java:215)

                at com.sun.faces.renderkit.ClientSideStateHelper.doGetState(ClientSideStateHelper.java:284)

                at com.sun.faces.renderkit.ClientSideStateHelper.getState(ClientSideStateHelper.java:244)

                at com.sun.faces.renderkit.ResponseStateManagerImpl.getState(ResponseStateManagerImpl.java:100)

                at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:534)

                at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:142)

                at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:301)

                at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:301)

                at org.richfaces.application.GlobalResourcesViewHandler.restoreView(GlobalResourcesViewHandler.java:179)

                at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:301)

                at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:192)

                at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

                at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)

                at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

                at org.apache.deltaspike.jsf.impl.listener.request.DeltaSpikeLifecycleWrapper.execute(DeltaSpikeLifecycleWrapper.java:89)

                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)

                at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

                at util.OpenSessionInViewFilter.doFilter(OpenSessionInViewFilter.java:50)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)

                at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)

                at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)

                at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)

                at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)

                at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)

                at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)

                at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)

                at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)

                at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)

                at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)

                at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)

                at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)

                at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)

                at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)

                at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)

                at com.sun.grizzly.ContextTask.run(ContextTask.java:71)

                at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)

                at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)

                at java.lang.Thread.run(Thread.java:745)

             

            Grave: java.lang.NullPointerException

                at com.sun.faces.context.PartialViewContextImpl.createPartialResponseWriter(PartialViewContextImpl.java:469)

                at com.sun.faces.context.PartialViewContextImpl.access$300(PartialViewContextImpl.java:76)

                at com.sun.faces.context.PartialViewContextImpl$DelayedInitPartialResponseWriter.getWrapped(PartialViewContextImpl.java:603)

                at javax.faces.context.PartialResponseWriter.startDocument(PartialResponseWriter.java:115)

                at org.richfaces.context.PartialResponseWriterWrapper.startDocument(PartialResponseWriterWrapper.java:53)

                at com.sun.faces.context.AjaxExceptionHandlerImpl.handlePartialResponseError(AjaxExceptionHandlerImpl.java:201)

                at com.sun.faces.context.AjaxExceptionHandlerImpl.handle(AjaxExceptionHandlerImpl.java:126)

                at javax.faces.context.ExceptionHandlerWrapper.handle(ExceptionHandlerWrapper.java:97)

                at org.apache.deltaspike.jsf.impl.exception.control.BridgeExceptionHandlerWrapper.handle(BridgeExceptionHandlerWrapper.java:109)

                at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:119)

                at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)

                at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

                at org.apache.deltaspike.jsf.impl.listener.request.DeltaSpikeLifecycleWrapper.execute(DeltaSpikeLifecycleWrapper.java:89)

                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)

                at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

                at util.OpenSessionInViewFilter.doFilter(OpenSessionInViewFilter.java:50)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)

                at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)

                at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)

                at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)

                at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)

                at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)

                at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)

                at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)

                at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)

                at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)

                at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)

                at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)

                at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)

                at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)

                at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)

                at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)

                at com.sun.grizzly.ContextTask.run(ContextTask.java:71)

                at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)

                at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)

                at java.lang.Thread.run(Thread.java:745)

             

            Grave:     at com.sun.faces.context.PartialViewContextImpl.createPartialResponseWriter(PartialViewContextImpl.java:469)

            Grave:     at com.sun.faces.context.PartialViewContextImpl.access$300(PartialViewContextImpl.java:76)

            Grave:     at com.sun.faces.context.PartialViewContextImpl$DelayedInitPartialResponseWriter.getWrapped(PartialViewContextImpl.java:603)

            Grave:     at javax.faces.context.PartialResponseWriter.startDocument(PartialResponseWriter.java:115)

            Grave:     at org.richfaces.context.PartialResponseWriterWrapper.startDocument(PartialResponseWriterWrapper.java:53)

            Grave:     at com.sun.faces.context.AjaxExceptionHandlerImpl.handlePartialResponseError(AjaxExceptionHandlerImpl.java:201)

            Grave:     at com.sun.faces.context.AjaxExceptionHandlerImpl.handle(AjaxExceptionHandlerImpl.java:126)

            Grave:     at javax.faces.context.ExceptionHandlerWrapper.handle(ExceptionHandlerWrapper.java:97)

            Grave:     at org.apache.deltaspike.jsf.impl.exception.control.BridgeExceptionHandlerWrapper.handle(BridgeExceptionHandlerWrapper.java:109)

            Grave:     at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:119)

            Grave:     at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)

            Grave:     at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

            Grave:     at org.apache.deltaspike.jsf.impl.listener.request.DeltaSpikeLifecycleWrapper.execute(DeltaSpikeLifecycleWrapper.java:89)

            Grave:     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)

            Grave:     at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)

            Grave:     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)

            Grave:     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

            Grave:     at util.OpenSessionInViewFilter.doFilter(OpenSessionInViewFilter.java:50)

            Grave:     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)

            Grave:     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

            Grave:     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)

            Grave:     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)

            Grave:     at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)

            Grave:     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)

            Grave:     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)

            Grave:     at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)

            Grave:     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)

            Grave:     at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)

            Grave:     at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)

            Grave:     at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)

            Grave:     at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)

            Grave:     at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)

            Grave:     at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)

            Grave:     at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)

            Grave:     at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)

            Grave:     at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)

            Grave:     at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)

            Grave:     at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)

            Grave:     at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)

            Grave:     at com.sun.grizzly.ContextTask.run(ContextTask.java:71)

            Grave:     at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)

            Grave:     at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)

            Grave:     at java.lang.Thread.run(Thread.java:745)

            Advertência: StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception

            java.lang.NullPointerException

                at com.sun.faces.context.PartialViewContextImpl.createPartialResponseWriter(PartialViewContextImpl.java:469)

                at com.sun.faces.context.PartialViewContextImpl.access$300(PartialViewContextImpl.java:76)

                at com.sun.faces.context.PartialViewContextImpl$DelayedInitPartialResponseWriter.getWrapped(PartialViewContextImpl.java:603)

                at javax.faces.context.PartialResponseWriter.startDocument(PartialResponseWriter.java:115)

                at org.richfaces.context.PartialResponseWriterWrapper.startDocument(PartialResponseWriterWrapper.java:53)

                at com.sun.faces.context.AjaxExceptionHandlerImpl.handlePartialResponseError(AjaxExceptionHandlerImpl.java:201)

                at com.sun.faces.context.AjaxExceptionHandlerImpl.handle(AjaxExceptionHandlerImpl.java:126)

                at javax.faces.context.ExceptionHandlerWrapper.handle(ExceptionHandlerWrapper.java:97)

                at org.apache.deltaspike.jsf.impl.exception.control.BridgeExceptionHandlerWrapper.handle(BridgeExceptionHandlerWrapper.java:109)

                at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:119)

                at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)

                at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

                at org.apache.deltaspike.jsf.impl.listener.request.DeltaSpikeLifecycleWrapper.execute(DeltaSpikeLifecycleWrapper.java:89)

                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)

                at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

                at util.OpenSessionInViewFilter.doFilter(OpenSessionInViewFilter.java:50)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)

                at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)

                at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)

                at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)

                at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)

                at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)

                at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)

                at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)

                at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)

                at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)

                at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)

                at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)

                at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)

                at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)

                at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)

                at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)

                at com.sun.grizzly.ContextTask.run(ContextTask.java:71)

                at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)

                at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)

                at java.lang.Thread.run(Thread.java:745)

             

            • 3. Re: Bug: RF 4.5.8 fileUpload =>"java.util.zip.ZipException: invalid literal/lengths set"
              Michal Petrov Master

              Ok, so it's an NPE in the responseWriter then. If you could try other versions it would at least narrow down the possible causes. Have you tried uploading a file without calling a listener?

              • 4. Re: Bug: RF 4.5.8 fileUpload =>"java.util.zip.ZipException: invalid literal/lengths set"
                Edilmar Alves Expert

                I tried now with RF 4.5.6 and 4.5.7. Until 4.5.6 all works fine. Then, the problem started in 4.5.7.

                • 5. Re: Bug: RF 4.5.8 fileUpload =>"java.util.zip.ZipException: invalid literal/lengths set"
                  Jason Nielson Newbie

                  I'm also experiencing problems now with the FileUpload component in the RF 4.5.8.  It was working fine for me in RF 4.5.5.  Using jboss-eap-6.2.

                  Here is my stack trace:

                   

                  Exception during request processing:

                  Caused by java.util.zip.ZipException with message: "invalid distance too far back"

                  java.util.zip.InflaterInputStream.read(InflaterInputStream.java:164)

                  java.util.zip.GZIPInputStream.read(GZIPInputStream.java:116)

                  java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java:2308)

                  java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2321)

                  java.io.ObjectInputStream$BlockDataInputStream.readLong(ObjectInputStream.java:2840)

                  java.io.ObjectInputStream.readLong(ObjectInputStream.java:980)

                  java.io.ObjectStreamClass.readNonProxy(ObjectStreamClass.java:672)

                  java.io.ObjectInputStream.readClassDescriptor(ObjectInputStream.java:828)

                  java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1599)

                  java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1515)

                  java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769)

                  java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)

                  java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)

                  com.sun.faces.renderkit.ClientSideStateHelper.doGetState(ClientSideStateHelper.java:305)

                  com.sun.faces.renderkit.ClientSideStateHelper.getState(ClientSideStateHelper.java:244)

                  com.sun.faces.renderkit.ResponseStateManagerImpl.getState(ResponseStateManagerImpl.java:100)

                  com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:534)

                  com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:142)

                  org.jboss.seam.jsf.SeamViewHandler.restoreView(SeamViewHandler.java:194)

                  javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:301)

                  org.richfaces.application.GlobalResourcesViewHandler.restoreView(GlobalResourcesViewHandler.java:179)

                  com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:192)

                  com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

                  com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)

                  com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

                  javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)

                  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)

                  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

                  org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)

                  org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)

                  org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

                  com.agencyworks.ai.util.ForwardedHttpsDecoderFilter.doFilter(ForwardedHttpsDecoderFilter.java:61)

                  org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

                  org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)

                  org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)

                  org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)

                  org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

                  org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)

                  org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)

                  org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

                  com.agencyworks.ai.util.AILoggingFilter.doFilter(AILoggingFilter.java:48)

                  org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

                  org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)

                  org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

                  org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)

                  org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

                  org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)

                  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

                  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

                  org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)

                  org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)

                  org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:407)

                  org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)

                  org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145)

                  org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)

                  org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)

                  org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336)

                  org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)

                  org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)

                  org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926)

                  java.lang.Thread.run(Thread.java:724)

                  • 6. Re: Bug: RF 4.5.8 fileUpload =>"java.util.zip.ZipException: invalid literal/lengths set"
                    Michal Petrov Master

                    jsnielson if there are other exceptions in the log after this one then that's not the root cause (see above). I am however unable to reproduce it.

                     

                    EDIT: You can try disabling the fileUploadListener, if it still fails the problem is in the uploading. Seeing some code would certainly help.

                    • 7. Re: Bug: RF 4.5.8 fileUpload =>"java.util.zip.ZipException: invalid literal/lengths set"
                      Edilmar Alves Expert

                      Michael, does actual Showcase use 4.5.8? Because I tested it and run fine. Looking at the code it uses fileUploadListener exactly like me.

                      • 8. Re: Bug: RF 4.5.8 fileUpload =>"java.util.zip.ZipException: invalid literal/lengths set"
                        Michal Petrov Master

                        Yes, Showcase uses 4.5.8 (it's written on the bottom).

                        • 9. Re: Bug: RF 4.5.8 fileUpload =>"java.util.zip.ZipException: invalid literal/lengths set"
                          Jason Nielson Newbie

                          That is all the stacktrace.  I did also try to disable the fileUploadListener (by removing fileUploadListener="#{documentVaultListController.listener}" from the rich:fileUpload). The error messages sometimes vary, all things being the same.  Here are four different error messages, all produced by trying to upload a file:

                           

                          Caused by java.util.zip.ZipException with message: "invalid code -- missing end-of-block”

                          Caused by java.util.zip.ZipException with message: "invalid distances set”

                          Caused by java.util.zip.ZipException with message: "invalid literal/lengths set”

                          Caused by java.util.zip.ZipException with message: "invalid code lengths set"


                          This was working on 4.5.5 and stopped working when I upgraded to 4.5.8

                          Here is how I've implemented the componenent:

                           

                          <rich:fileUpload

                            fileUploadListener="#{documentVaultListController.listener}"

                            id="fileUploads"

                            addControlLabel="Choose file..."

                            allowFlash="false"

                            listHeight="320"

                            clearLabel=" "

                            uploadControlLabel="Upload"

                            autoClear="false"

                            immediateUpload="true"

                            createTempFiles="true"

                            maxFilesQuantity="#{documentVaultListController.getMaxFilesAvailable()}"

                            render="editPopup"

                            onuploadcomplete="editFile();"

                            onclear="clearFile();">

                            <f:facet name="label">

                            <h:outputText

                            value="{_KB}KB from {KB}KB uploaded --- {mm}:{ss}" />

                            </f:facet>

                           

                            <a:ajax

                            event="uploadcanceled"

                            execute="ndDiv">

                            <a:param

                            name="fname"

                            noEscape="true"

                            value="(event.memo.entry) ? event.memo.entry.fileName : '' "

                            assignTo="#{documentVaultListController.fileName}"

                            actionListener="#{documentVaultListController.clearCancelledUpload}" />

                            </a:ajax>

                            </rich:fileUpload>


                          And here is the listener:

                           

                          public synchronized void listener(FileUploadEvent event) {

                            UploadedFile uploadedFile = event.getUploadedFile();

                            File tempFile = null;

                            if(itemsToUpload == null){

                            itemsToUpload = new HashMap<String, DocumentVaultItem>();

                            }

                           

                            try {

                            byte[] fileInBytes = new byte[(int) uploadedFile.getData().length];

                            tempFile = new File(uploadedFile.getName());

                           

                            InputStream is = uploadedFile.getInputStream();

                            FileOutputStream fos = new FileOutputStream(tempFile);

                            byte[] buffer = new byte[1024];

                            int bytesRead;

                            // read from is to buffer

                            while ((bytesRead = is.read(buffer)) != -1) {

                            fos.write(buffer, 0, bytesRead);

                            }

                            is.close();

                            fos.flush();

                            fos.close();

                           

                            FileInputStream fileInputStream = new FileInputStream(tempFile);

                            fileInputStream.read(fileInBytes);

                            fileInputStream.close();

                           

                            if (fileInBytes.length > 0) {

                            selectedItem = new DocumentVaultItem();

                            // if not doing memo attachments, automatically save to doc vault

                            if (memoType.equals("")) {

                            selectedItem.setSaveToDocVault(true);

                            }

                            selectedItem.setName("");

                            selectedItem.setFileName(uploadedFile.getName());

                            selectedItem.setFileSize(fileInBytes.length);

                            selectedItem.setData(fileInBytes);

                            itemsToUpload.put(uploadedFile.getName(), selectedItem);

                            } else {

                            log.error("DocumentVaultListController - listener uploading file with no data: #0",uploadedFile.getName());

                            Event.invalidData("File Problem","There was a problem uploading file "+ uploadedFile.getName()+ ".  Please try again or upload a different file.");

                            }

                            } catch (FileNotFoundException fnfe) {

                            log.error("DocumentVaultListController - listener FileNotFoundException",fnfe);

                            Event.invalidData("File Problem", "Error reading file '"+ uploadedFile.getName()+ "'.  Please try again or upload a different file.");

                            } catch (SecurityException se) {

                            log.error("DocumentVaultListController - listener SecurityException",se);

                            Event.invalidData("File Problem","Security Exception reading file '"+ uploadedFile.getName()+ "'.  Please try again or upload a different file.");

                            } catch (IOException ioe) {

                            log.error("DocumentVaultListController - listener IOException", ioe);

                            Event.invalidData("File Problem", "Problem reading file '"+ uploadedFile.getName()+ "'.  Please try again or upload a different file.");

                            }finally{

                            if(tempFile!=null){

                            tempFile.delete();

                            }

                            }

                           

                            }