| Summary: | Occasional "zip file closed" error, when extract=false is used for webapp | ||
|---|---|---|---|
| Product: | [RT] Jetty | Reporter: | vgarnashevich |
| Component: | server | Assignee: | Jan Bartel <janb> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | janb, jetty-inbox, vgarnashevich |
| Version: | 7.5.4 | ||
| Target Milestone: | 7.5.x | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
vgarnashevich
Have a read of this troubleshooting wiki page: http://docs.codehaus.org/display/JETTY/ZIP+exception+reading+jar+or+war+files Does that cover your situation? Jan The exception can happen right after application start, on first page refresh. The JAR file with the webapp is not being updated. The resources, on which the exception occurs, are not packed inside additional JARs, within the webapp's JAR. The webapp is deployed as an OSGi application, and OSGiAppProvider is configured with parameter extract=false. In your osgi setup, do you have a jetty.xml file anywhere? Or one called jetty-osgi-default.xml? If so, can you add near the top of that file, the following line: <Set class="org.eclipse.jetty.util.resource.Resource" name="defaultUseCaches">false</Set> That should ensure that jetty tells the jvm not to cache jar url connection streams, which is the cause of that bug. There may, however, be 1 or 2 places in relatively newish code that opens a jar url connection directly and thus won't use this workaround - I'll have a trawl through the code and see if I can find any, but it would be good if you could try the above in the meanwhile. thanks Jan I've tried to set defaultUseCaches=false, and it helped. Good. Although your problem is fixed with the Resource.setDefaultUseCaches, I am marking this bug as "fixed", as I've also modified the code in a few places that was doing direct Url.openStream. Jan |