ProgramClassLoader getResource doesn't work correctly

Description

The current implementation will always return the resource as get from the system classloader, unfiltered.

E.g. if the user uses his own version of snappy library, every Snappy classes will be loaded from the program class loader (which is correct), however, if he does getResource through the program class loader, the resource returned is always from the cdap system class loader, which can be of different snappy version than the user program is using.

Release Notes

None

Activity

Show:

Sreevatsan Raman July 30, 2015 at 4:56 AM

This issues doesn't happen after the recent changes. Verified by including avro-1.7.0.jar in the resources and fetched it using program classloader. Was able to get the right URL for avro-1.7.0.jar. Marking as resolved.

Albert Shau July 29, 2015 at 6:02 PM

things have changed a little bit since this jira was opened after bug fixes to FilterClassLoader. System resources are no longer visible to ProgramClassLoader, though I'm not sure if it will have access to non-class resources from the class path.

Priyanka Nambiar July 14, 2015 at 9:12 PM

pls check if this issue is still relevant, and maybe add a note here?

Priyanka Nambiar March 25, 2015 at 1:08 AM

Marking as a blocker for 3.0

Terence Yim January 27, 2015 at 3:26 AM

The proper fix is to have the ProgramResources class to include not just .class, but also any files from permitted class path as its visible resources.

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Affects versions

Components

Fix versions

Priority

Created January 27, 2015 at 3:25 AM
Updated July 30, 2015 at 4:56 AM
Resolved July 30, 2015 at 4:56 AM