Jetty - java.lang.IllegalStateException: zip file closed

前端 未结 6 1231
难免孤独
难免孤独 2021-01-12 05:05

I\'m getting some error with some connection to our web server.

I saw that a bug causing this was solved in Jetty 7.6. Yes we get this error on our application runn

相关标签:
6条回答
  • 2021-01-12 05:24

    This issue can also occur if you are doing any of your own reflection in that code path.

    0 讨论(0)
  • 2021-01-12 05:28

    I had the same problem, after deleting all .jar files and build the path to all .jar file once again. Now it's working properly

    0 讨论(0)
  • 2021-01-12 05:31

    You don't need to test all files to ensure the correctness of them. Just put a break point at java.util.zip.ZipFile.ensureOpen(ZipFile.java:632) and check the name field in ZipFile class: private final String name

    0 讨论(0)
  • 2021-01-12 05:38

    I was having the same issue because of the actual WAR being corrupt. Try rerunning mvn clean install and redeploy.

    0 讨论(0)
  • 2021-01-12 05:39

    There are 2 main causes for this.

    1. A bad/corrupt JAR file in your classpath.
    2. The JVM built-in URL caching getting in the way.

    For a bad/corrupt JAR file, you'll have to isolate that on your own, figure out which one it is. Maybe by just unjaring all of them one by one till you find the problematic one.

    As for the JVM URL caching, this seems to cause problems with dynamic classloaders like OSGi or hot-deploy scenarios the most.

    For this scenario, you can tell jetty to set the URLConnection.setUseCaches(boolean) for each URLConnection attempt of its own.

    To disable the JVM caches, add the following snippet of XML to your etc/jetty.xml

    <Set class="org.eclipse.jetty.util.resource.Resource"
         name="defaultUseCaches">false</Set>
    
    0 讨论(0)
  • 2021-01-12 05:42

    I had the same problem after deploying jenkins war; all I had to do was to restart the server after the deploy. Hope it helps.

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