<< Back to previous view

[CLASSPATH-1] clojure.java.classpath/system-classpath is incorrect when running in a classloader other than the application classloader Created: 13/Sep/11  Updated: 08/Jan/14  Resolved: 27/Jan/12

Status: Closed
Project: java.classpath
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Justin Balthrop Assignee: Stuart Sierra
Resolution: Duplicate Votes: 0
Labels: None

Attachments: File system-classpath.diff    
Patch: Code and Test

 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.



 Comments   
Comment by Justin Balthrop [ 13/Sep/11 8:56 PM ]

Hugo provides a more general solution in CLASSPATH-2.

Comment by Stuart Sierra [ 27/Jan/12 9:44 AM ]

Resolved by CLASSPATH-2

Generated at Sat Nov 22 05:56:23 CST 2014 using JIRA 4.4#649-r158309.