JSF2 on Jetty gives randomly 'zip file closed' but works when running from maven jetty plugin (jetty:run)

前端 未结 3 1764
栀梦
栀梦 2020-12-30 16:52

my JSF web app is giving randomly error: \"zip file closed\" when accessing files (like images, css, js). It is deployed on Jetty 7. It looks like some of those files are no

相关标签:
3条回答
  • 2020-12-30 17:32

    This issue has been fixed in jetty-7.6.0.RC2. The bug is caused by the JVM caching jar url connection streams.

    According to the bug report, you will need to also add the following to the jetty.xml:

     <Set class="org.eclipse.jetty.util.resource.Resource" name="defaultUseCaches">false</Set>
    
    0 讨论(0)
  • 2020-12-30 17:34

    I had the same issue and managed to solve it by going to etc\webdefault.xml and changing this param to false:

    <init-param>
      <param-name>gzip</param-name>
      <param-value>true</param-value>
    </init-param>
    
    0 讨论(0)
  • 2020-12-30 17:39

    Jetty looks for your resources in the jar files in WEB-INF/lib. When it searches jsf-impl.jar it is somehow closed, probably by a JSF request. Perhaps jsf does its own resource handling and messes about with the files itself.

    Anyway, the solution seems to be to move the jsf jars out of the war-file. Set your jsf dependency scope to provided so maven does not package them in the war file, and get them on the server, probably in the lib folder in jetty standalone.

    0 讨论(0)
提交回复
热议问题