java.classpath

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

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • 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.

Activity

Hide
Stuart Sierra added a comment -

Resolved by CLASSPATH-2

Show
Stuart Sierra added a comment - Resolved by CLASSPATH-2
Hide
Justin Balthrop added a comment -

Hugo provides a more general solution in CLASSPATH-2.

Show
Justin Balthrop added a comment - Hugo provides a more general solution in CLASSPATH-2.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: