我正在尝试使用 Oracle Java Mission control 分析 Java Spring 应用程序。我将 JVM 连接配置为:localhost:7091
并且我使用java -Dcom.sun.management.jmxremote.rmi.port=7091 -jar app.jar
.
当我尝试启动飞行记录器时,我收到一条错误消息。
Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused: connect]
Could not connect to a JVM at service:jmx:rmi:///jndi/rmi://localhost:7091/jmxrmi. Make sure one is running and that you are using the correct protocol in the Service URL.
有谁知道该错误的原因可能是什么?