JDK-4428253 : NoClassDefFoundError when # char in directory name
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2001-03-21
  • Updated: 2001-03-24
  • Resolved: 2001-03-24
Related Reports
Duplicate :  
Description

Name: md23716			Date: 03/21/2001

OS: -Discovered on Windows2000, but affects All Platforms
JDK: 1.3.1-rc1-b19
Related Sunbugs #'s: 4273532, 4294586

The inital problem manifested itself when a class file was located in a
directory with a '#' in its title (i.e. c:\a#b). When running the program
(by issuing java <classname>) an exception is thrown:

     Exception in thread "main" java.lang.NoClassDefFoundError

This problem was fixed as described in Bug ID 4273532 and 4294586. However,
the changes made in this fix potentially affect numerous other files. The
reason for this is because when a URL is instantiated it encodes a file's
pathname in order to escape reserved URL characters. Thereafter any call to
URL.getFIle() would return an encoded version of the path. I believe the
orginal fix may have accounted for some of these scenario's, but others
have been overlooked. For example ExtCheck.java has a call to URL.getFile()
and at this stage the returned String should be decoded with a call to
ParseUtil.decode(). Because this call is missing the original problem is
reinstated when using the extcheck tool.

To recreate this problem perform the following steps:

1. Create a directory with a '#' in its title. i.e. mkdir a#b
2. Copy/Create a Jar file in this directory
3. Run ExtCheck on this Jar file i.e extcheck <name of jar>.jar
4. Receive following exception:

     IO Exception occurred

This is just one scenario where a call to URL.getFile() should be decoded,
there are numerous other that need to be looked into in order to complete
the fix detailed in the aforementioned sunbugs.

======================================================================

Comments
EVALUATION These other areas including ExtCheck have been addressed in the fix for 4416056 michael.mccloskey@eng 2001-03-23
23-03-2001