clojure.java.classpath/system-classpath is incorrect when running in a classloader other than the application classloader

Description

Because system-classpath uses java.class.path, it doesn't work when running in a classloader other than the application classloader.

This happens when running in any container that uses a custom classloader (e.g. Jetty, Cake, TomCat).

The fix is to use (.getURLs (.getClassLoader clojure.lang.RT)) instead of (System/getProperty "java.class.path"). A patch is attached.

Environment

None

Activity

Show:
Justin Balthrop
September 14, 2011, 2:56 AM

Hugo provides a more general solution in CLASSPATH-2.

Stuart Sierra
January 27, 2012, 3:44 PM

Resolved by CLASSPATH-2

Duplicate

Assignee

Stuart Sierra

Reporter

Justin Balthrop

Labels

None

Approval

None

Patch

Code and Test

Priority

Major
Configure