Michal
Michal

Reputation: 677

connect with jmx secured by username/password

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?

Upvotes: 1

Views: 474

Answers (1)

Michal
Michal

Reputation: 677

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"))

Upvotes: 1

Related Questions