Class loading issue causing resource-response to fail on some servlet containers #5

Closed
wants to merge 2 commits into
from

2 participants

@teropa

Ring currently uses the classloader that loaded java.lang.System in resource-response. This classloader doesn't necessarily have access to resources in the WAR, since it may well be higher in the classloader hierarchy.

I think it's considered a best practice to use the context classloader in situations like this. I've applied this change to my fork.

The problem is present at least in Winstone. Tomcat documentation implies it might also behave similarly, but I haven't yet checked this.

I also added a test case which illustrates the problem.

@weavejester
Collaborator

Looks fine. Thanks for the patch!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment