Mantis - Resin
Viewing Issue Advanced Details
6495 minor always 02-21-25 17:26 02-21-25 17:44
nam  
nam  
normal  
assigned 4.0.67  
open  
none    
none  
0006495: classloader cannot lookup directories within some jars
(rep by Y. Suzuki)

The following would return null for certain JARs:

    Thread.currentThread().getContextClassLoader().getResources("META-INF")

It would fail if the 29th byte from the end of the jar is the value 'P'. This means there is a 1/256 chance that the jar would be affected.

Notes
(0007339)
nam   
02-21-25 17:44   
This bug happens when Resin is checking for PACK200 header bytes. Resin thinks it's a bad jar so it falls back to Java's jar reader. But when falling back, Resin fails to normalize and remove the trailing slash from the directory names.

PACK200 is deprecated per https://openjdk.org/jeps/367. [^] The following snapshot build removes PACK200 checking from Resin's internal jar reader:

    https://www.caucho.com/download/snapshot/resin-pro-4.0.s250221.tar.gz [^]
    https://www.caucho.com/download/snapshot/resin-pro-4.0.s250221.zip [^]

The snapshot fixes the bug for regular jars, but PACK200 jars should still have this issue.