Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Clojure 通过用户名/密码保护的jmx连接_Clojure_Jmx - Fatal编程技术网

Clojure 通过用户名/密码保护的jmx连接

Clojure 通过用户名/密码保护的jmx连接,clojure,jmx,Clojure,Jmx,使用clojure.java.jmx,我正在尝试连接受用户名/密码保护的jmx服务器: (jmx/with-connection {:host "my.server", :port 50001 :environment {"jmx.remote.credentials" ["username" "password"]}} (jmx/mbean "java.lang:type=OperatingSystem")) 但我得到的是: ClassNotFoundException clojure.la

使用clojure.java.jmx,我正在尝试连接受用户名/密码保护的jmx服务器:

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

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

我在想这里发生了什么事?

啊。。。对不起,伙计们。我只是找到了一个理由。作为clojure新手,我尝试将环境参数作为clojure向量而不是字符串的java数组发送。以下是解决我的问题的代码片段:

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

也许我能帮上忙谢谢,我也经历过这一次。不幸的是,对于基于普通环的应用程序,我无法真正理解java.rmi.server.codebase应该指向什么。