Sun Java System Application Server Platform Edition 8.1 2005Q2 Update 2 Troubleshooting Guide

- Previous: Description
- Next: Cannot Reinstall Application Server After Manual Deletion of Directories

## Solution

Be sure to close streams opened by your applications. Also, if an application needs to be redeployed or undeployed repeatedly, and also needs to obtain a resource from a `jar` file using `getResource` or `getResourceAsStream`, consider using `getClass().getResource` which returns a URL object, then invoke the `url.setUseCaches` method to turn off caching for that `jar` file, and then use `url.getInputStream()` to obtain the stream.

Although turning off caching for accesses to the `jar` file can slow down performance, this approach does allow the application to be undeployed or redeployed. Note also that if the `getClass().getResourceAsStream` method is used instead, then the `jar` file in which the resource is located will be cached (this is the default Java runtime setting) and remain open until the server is stopped.

- Previous: Description
- Next: Cannot Reinstall Application Server After Manual Deletion of Directories

- © 2010, Oracle Corporation and/or its affiliates