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

前端 未结 3 1766
栀梦
栀梦 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: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.

提交回复
热议问题