1

Using clojure.java.jmx I'm trying to connect with JMX server protected with username/password:

(jmx/with-connection {:host "my.server", :port 50001 :environment {"jmx.remote.credentials" ["username" "password"]}} (jmx/mbean "java.lang:type=OperatingSystem"))

But what I get is:

ClassNotFoundException clojure.lang.PersistentVector (no security manager: RMI class loader disabled)  sun.rmi.server.LoaderHandler.loadClass (LoaderHandler.java:396)

Aby thoughts what's happened here?

Michal
  • 677
  • 6
  • 16
  • maybe [thia answer](http://stackoverflow.com/a/6348219/642340) can help – soulcheck Oct 02 '14 at 21:26
  • Thanks, I went through this one as well. Unfortunately I can't really figure out what the java.rmi.server.codebase should point to in case of plain ring-based app. – Michal Oct 03 '14 at 10:35

1 Answers1

1

aghh... sorry guys. I just found a reason. as a clojure newbe I tried to send environment parameters as clojure Vector instead of java array of Strings. Following is the snippet which solves my problem:

(jmx/with-connection {:host "my.server", :port 50001 :environment {"jmx.remote.credentials" (into-array String ["username" "password"])}} (jmx/mbean "java.lang:type=OperatingSystem"))
Michal
  • 677
  • 6
  • 16