<< Back to previous view

[CONTRIB-112] clojure.java.classpath/system-classpath is incorrect when running in a classloader other than the application classloader Created: 07/Jul/11  Updated: 27/Jan/12  Resolved: 27/Jan/12

Status: Resolved
Project: Clojure-Contrib
Component/s: None
Affects Version/s: None
Fix Version/s: None

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

Attachments: File system-classpath2.diff     File system-classpath.diff    
Patch: Code

 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 [ 07/Jul/11 1:52 PM ]

Here is an updated patch with a fix for the system-classpath docstring as well.

Comment by Justin Balthrop [ 13/Sep/11 4:02 PM ]

Any update on this?

Comment by Justin Balthrop [ 13/Sep/11 7:04 PM ]

There is now a ticket in the CLASSPATH project for this (http://dev.clojure.org/jira/browse/CLASSPATH-1).

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

CLASSPATH-1

Generated at Sat Oct 25 19:23:47 CDT 2014 using JIRA 4.4#649-r158309.