Download
Abstract
URLs returned from ClassLoader.getResource encode spaces as "%20". Not decoding can cause application failures.
Download Description
PK64379 resolves the following problem:
ERROR DESCRIPTION:
Change in behavior from IBM Websphere application Server V6.1.0.13 to V6.1.0.15. Applications that rely on unencoded spaces in URLs returned from ClassLoader.getResource will fail. Exceptions may show folder names with %20 java.io.FileNotFoundException:
C:\Program%20Files\IBM\WebSphere\AppServer\profiles\AppSrv01\...
(The system cannot find the path specified.)
LOCAL FIX:
PROBLEM SUMMARY
USERS AFFECTED:
WebSphere Application Server V6.1 users who install applications to a directory with a space in the name. In particular, Microsoft Windows users who install the product to C:\Program Files\.
PROBLEM DESCRIPTION:
URLs returned from ClassLoader.getResource encode spaces as "%20". Not decoding can cause application failures.
The fix for PK57900 modified class loader behavior so that the opaque URLs returned by application class loaders return spaces encoded as "%20". This behavior matches java.net.URLClassLoader, and it is required behavior for the URL.toURI() method, which was introduced in Java™ SE 5, to work properly.
PROBLEM CONCLUSION:
The class loader has been changed to behave as it did prior to V6.1.0.15 in order to maintain backwards compatibility with existing applications. To enable the behavior introduced in PK57900, you can set the system property:
com.ibm.ws.classloader.encodeResourceURLs
The valid values are false, which is default and causes behavior to match releases prior to V6.1.0.15 by preventing URLs from being encoded, which causes URLs to be encoded as intended by PK57900. Jave Virtual Machine (JVM) custom properties are described by this Information Center article:
Java Virtual Machine custom properties
Regardless of the setting, you are encouraged to use URL.openConnection() to avoid dependencies on the structure of the URLs returned by a class loader.
You are encouraged to set the system property to ensure portability between different environments; for example, URLClassLoader in a non-server test environment will return encoded URLs. If the system property is set and URL.openConnection() is insufficient, you are encouraged to construct java.io.File objects using the result of URL.toURI(), which can only be used reliably when the system property is set. If URL.getPath() or URL.getFile() must be used, then the result must be decoded before it is used.
The fix for this APAR is currently targeted for inclusion in Fix Pack 6.1.0.17. Please refer to the Recommended Updates page for delivery information:
http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980.
For WebSphere Application Server zOS customers, the fix for this APAR is currently targeted for inclusion in Fix Pack 6.1.0.16. Application Server for z/OS customers should follow their normal PTF ordering process. Please refer to the support page download section for additional PTF information:
http://www-306.ibm.com/software/webservers/appserv/zos_os390/support/
Prerequisites
Please download the UpdateInstaller below to install this fix.
Installation Instructions
Please review the readme.txt for detailed installation instructions.
Download Package
Download package |
What is Fix Central (FC)? |
What is DD? |
Download | RELEASE DATE | LANGUAGE | SIZE(Bytes) | Download Options | ||
---|---|---|---|---|---|---|
6.1.0.15-WS-WAS-IFPK64379 | 4/16/2008 | US English | 15402 | FC | FTP | DD |
Technical Support
Contact IBM Support using SR (http://www-306.ibm.com/software/support/probsub.html), visit the WebSphere Application Server Support Web site (http://www.ibm.com/software/webservers/appserv/was/support/), or contact 1-800-IBM-SERV(U.S. only).
Problems (APARS) fixed
Was this topic helpful?
Document Information
Modified date:
15 June 2018
UID
swg24018970